Open CarlosZiegler opened 1 year ago
Seems like there are plenty of benefits... just by looking at the readme and it's feature set that I copied below
I'm here because mainly of feature #1 that I want to try to use the XState chart as a reducer! To have all that logic within a statechart machine seems super compelling... what do did you finding interesting @CarlosZiegler?
Use statecharts as reducers: Call createMachine
, then pass it into createXStateSlice
, and you're good to go. You can use 100% of XState's features right alongside Redux.
Use sendParent to send events to Redux: The Redux store is your machine's 'parent', meaning you can call sendParent
to send actions to Redux. In future versions of XState, you'll be able to call parent.getSnapshot()
to grab the Redux store's state.
Colocate side effects with your Redux logic: No more splitting out side effects from your app logic. Use invoke
, actions
and even spawn actors in your XState machines.
@mattpocock also be cool to enable Discussions on this repo because obviously we both don't have any issues here - all praise!
Really interesting approach. I will ask what is the benefit using like that ?
Thanks