How does the canvas library fit into the flow template and respond?

I love the way Flux focuses on the separation of concerns and unidirectional data flow, but it also makes me wonder how I should include a canvas library such as fabricJS .

FabricJS creates an object model on its own canvas element to extend and simplify functions. My question is whether to initialize the canvas FabricJS element in the View (React) component and process all actions on the canvas directly in the view and save and update the state of the canvas or by setting the canvas element in the View and then register all actions with the canvas in the Store and use the view to submit actions?

+5
source share
1 answer

Just send actions to save and listen to the changes using the canvas, if there are updates, update the canvas. Everything goes into action, call calls save data and emit changes. The component listens for changes and updates that it presents and views.

+1
source

All Articles