I'm newbie in react and redux.
Question: what is the best way to implement "datasource" (similar to kendo-ui datasource) in redux?
I've tried to store all of my widgets datasources in one place (i've created datasource reducer) and "bind" datasources to it's widgets (like table widget, listview, combobox etc). Datasources must have it's own api (like addFilter, addSort, getFiltered etc) and also store applied filters and data too.
I want to store all of datasources in redux store (that's why i need to create datasource and dispatch it's creation before widget is created).
The problem is when i create react-redux connector to my "smart" widget's container-component i need to send my datasource with props but at this moment datasource is not created.
If i send dummy initial datasource (without dispatch it's creation and data filling) and then dispatch it and fill data to it on componentDidMount - my widget's render function called twice
I think i need some kind of "wrapper" function but at now i have no idea how to do that.
Maybe there is some examples of how to implement "datasources functionality"?
Just let render be called twice. It's the right thing to do in react-land.
Stuff has changed. Let's re-render and let the diff-engine do it's thing.
You need to fully accept the action->reducer->smart-component dichotomy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With