prop<V> method

V prop<V>(
  1. Object? key
)

Gets a property from the store. This can be used to save global values, but scoped to the store. For example, you could save timers, streams or futures used by actions.

setProp("timer", Timer(Duration(seconds: 1), () => print("tick")));
var timer = prop<Timer>("timer");
timer.cancel();

See also: setProp and env.

Implementation

V prop<V>(Object? key) => store.prop<V>(key);