Giter Club home page Giter Club logo

Comments (3)

davidanitoiu avatar davidanitoiu commented on May 18, 2024 6

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

from react-flow-chart.

MrBlenny avatar MrBlenny commented on May 18, 2024 1

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.

from react-flow-chart.

prativm avatar prativm commented on May 18, 2024

@MrBlenny
Any update on this.? It would be great to have a clear idea of Redux implementation.

from react-flow-chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.