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();

This is also directly accessible in ReduxAction and in VmFactory, as prop.

See also: setProp and env.

Implementation

V prop<V>(Object? key) => _props[key] as V;