effect function

Effect effect(
  1. void fn()
)

Helper function to create and run an Effect.

Returns the created Effect instance, which can be disposed by calling Effect.dispose.

Implementation

Effect effect(void Function() fn) {
  return Effect(fn);
}