effect function
Implementation
types.Effect effect(void Function() run) {
final effect = Effect(run);
if (system.activeSub != null) {
system.link(effect, system.activeSub!);
} else if (system.activeScope != null) {
system.link(effect, system.activeScope!);
}
system.runEffect(effect);
return effect;
}