Closed akaegi closed 2 years ago
Sorry for the delay Andreas (see what I did there).
Your feature seems like a nice addition to this lib. I also really like the removal of Task.Delay in the unit tests. So thank you very much. Will publish a new version asap.
Overload for
ObserveAction
that allows the observers to get the state at the point when the action was dispatched.Use case: Action
ChangeNameAction
Action observer that persists the user object with the new changed name into a file. The handler needs the state at the point in time when the action was dispatched.Note that the handler cannot just simply get
Store.State
because it might have changed in the meanwhile (action observers might get called asynchronously or on different threads).I added an overload so that previous usages of
ObserveAction
remain valid (backwards compatibility).