Work in Progress
Effects are a way to trigger side effects with actions.
A one common, desirable side effect is an asynchronous HTTP call to the remote server to fetch or save entity data.
You implement one or more effects with the help of the @ngrx/effects
package.
Actions dispatched to the ngrx store can be detected and processed by your effect method. After processing, whether synchronously or asynchronously, your method can dispatch new action(s) to the store
The ngrx-data library implements an effect named persist$
in its EntityEffects
class.
The persist$
method filters for certain EntityAction.op
values.
These values turn into HTTP GET, PUT, POST, and DELETE requests with entity data.
When the server responds (whether favorably or with an error), the persist$
method dispatches new EntityAction
s to the store with the appropriate response data.
More to come on this subject