Open futbotism opened 6 years ago
I like the concept but the tricky thing is that dispatching the action is a multicast.
ie. The ReadReport
action could be handled by multiple states, and could even be handled multiple times within this state. How would the value of data
be determined? It would represent multiple return values.
I could foresee a syntax like this:
@Action(ofActionSuccessful(ReadReport))
But the value of the result is still a bit difficult to assertain.
Ah i didn't see that the ofActionSuccessful
pipeable operator doesn't actually deliver a value in its stream...
Yea i would rather use the ngxs built in action statuses than have to dispatch success and failure actions for every request.
On a side note, do you recommend using the patter of dispatching success and failure actions as a result of a request? eg.
ReadReport = '[Report] read report';
ReadReportSuccess = '[Report] read report success';
ReadReportFailure = '[Report] read report failure';
@futbotism https://github.com/ngxs-labs/emitter#lifecycle
what do you think about the simplified use of the actions
I did have a look at this pattern, and the simplification looks appealing, but i'm reluctant to move away from redux currently
@arturovt I think we update example into documentation
@markwhitfeld https://stackblitz.com/edit/ngxs-of-manage-operation
Duplicate https://github.com/ngxs/store/issues/488
Great library, im really finding ngxs's clean and straightforward approach a joy to write with
I'm submitting a...
Current behavior
As far as i know this is the only way to subscribe to an action status
Expected behavior
It would be neat if we could do this
This would reduce the boilerplate for traditional actions declarations and allows us to hook into the ngxs action stream more easily.