animal.actions.ts
.Store
service into your component/service and invoke the dispatch
function with an action or an array of actions you wish to trigger.dispatch
function actually returns an Observable, so we can subscribe to it and reset the form after it was successful.@Action
, therefore it's not realistically possible to return the state from these actions since we don't know the form of them.@Select
in the chain like:store.snapshot()
. This will return the entire value of the store for that point in time.store.reset(myNewStateObject)
will reset the entire state to the passed argument without firing any actions or life-cycle events.