You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first concern is that macro works as enhancement not replacement.
So adding a signal does not remove the annotated content thus leading to name collision or confusion.
When reading generated code think about we need to prefix or suffix using a common convention.
@Signalable()
final source =1;
// Generated+final source =signal(1);
// ============================@Combined()
plus2() => source +2;
// Generated+final plus2 =combined(() => source +2);
// ============================@Effect('log')
display() {
println(mapped.value);
}
// Generated+effect(() {
println(plus2.value);
}, debugLabel:'log')
// ============================@Signal(10, 'counter')
classFlux<int> {
@Assign()
intincrement(value) => value +1;
}
// Generated+classFluxextendsValueSignal<int> {
Flux():super(10, debugLabel:'counter');
intincrement(int by) {
value = value + by;
return value;
}
}
// ============================classHandler {
@Signal(8)
final source;
@Signal('')
final message;
}
// Generated+classHandler {
final source;
final message;
Handler() {
final source =signal(8);
final message =signal('');
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Very early but to start the discussion and team work I've pushed the most simplistic macro
https://github.com/rodydavis/signals.dart/tree/macros
Here is a sandbox to share ideas.
My first concern is that macro works as enhancement not replacement.
So adding a signal does not remove the annotated content thus leading to name collision or confusion.
When reading generated code think about we need to prefix or suffix using a common convention.
Beta Was this translation helpful? Give feedback.
All reactions