reducer icon indicating copy to clipboard operation
reducer copied to clipboard

Action composition?

Open etodanik opened this issue 2 years ago • 3 comments

In the JS-land Redux, one of the convenient things is having various patterns that allow you to dispatch actions based on actions dispatched. e.g thunks and more complex concepts like rx , sagas, epics in an asynchronous way that involves side effects. What would be the equivalent here?

etodanik avatar Dec 16 '23 08:12 etodanik

Hey Danny, could you give me a concrete example of what you would like to achieve?

brunocodutra avatar Dec 18 '23 19:12 brunocodutra

At the very minimum, side effects in UI. e.g: Launch an action that triggers an async function , respond with dispatching error/success actions.

etodanik avatar Dec 18 '23 20:12 etodanik

And how is this usually accomplished? I guess an interceptor between dispatchers and reducers that filter out "fake" actions and trigger side effects? You could do this by implementing trait Reducer for some type that wraps your actual state. The library doesn't currently provide any convenience utilities for this though :(

brunocodutra avatar Dec 23 '23 22:12 brunocodutra