Open phlickey opened 5 years ago
I was thinking another file containing redux actions would be added to this lib. These would roughly conform to the the existing type definitions but include an action name. For example
export type IOnDragNodeAction = (input: { config?: IConfig, event: MouseEvent, data: DraggableData, id: string }) => ({
type: 'REACT_FLOW_CHART/ON_DRAG_NODE',
config: IConfig,
event: MouseEvent,
data: DraggableData,
id: string
})
The state logic (that currently resided in the actions.ts file) would then be copied over to a reducer and changed so it no longer mutates.
Unfortunately, I'm quite busy right now so not sure if I'll be able to work on this soon.
@MrBlenny Any update on this.? It would be great to have a clear idea of Redux implementation.
Not sure if it's the correct way to do it, but here's how I did it.
I basically left the chart to itself, and let redux handle only the business logic.
https://codesandbox.io/s/qkz88 https://github.com/davidanitoiu/deployment-pipeline
@MrBlenny What's your vision for a "redux state container"?
Would this just be a story, similar to ExternalReactState except mapping the internal state actions to the redux action dispatcher?