Skip to content

Commit

Permalink
docs(data): clarify entity dispatcher fires action once (#4005)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Roberts <robertsbt@gmail.com>
  • Loading branch information
Nosfistis and brandonroberts authored Aug 14, 2023
1 parent 067b2b8 commit 7716e46
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ An entity argument **must never be a cached entity object**.
It can be a _copy_ of a cached entity object and it often is.
The demo application always calls these command methods with copies of the entity data.

All _command methods_ return `void`.
All _command methods_ return `void` or an `Observable`.
A core principle of the _redux pattern_ is that _commands_ never return a value. They just _do things_ that have side-effects.
Thus, the action is only dispatched when the command is invoked, and re-subscribing to a command's returned `Observable` will not
dispatch another action.

Rather than expect a result from the command,
you subscribe to a _selector$_ property that reflects
Expand Down

0 comments on commit 7716e46

Please sign in to comment.