4 ms·
do you just not use react state at all then? I have a similar sized app as you, we started off naively using state at various levels, over time we refactored th
by dustingetz 12y ago
do you just not use react state at all then? I have a similar sized app as you, we started off naively using state at various levels, over time we refactored the state higher and higher, and now we are at the point where all the state is kept only at the root of the view hierarchy (we use cursors). We're about one step away from lifting even that state out of react and into a store layer that has no react dependencies.
- wingspan 12y agoThat's about right. We really only use state for transient display properties, mostly toggling display of some component.
- jingc 12y agoWe do still use React state, especially for view state like whether a piece of text is expanded or whether the viewer has toggled the grid or list view on a table. But as you said, most of our data is pulled into a store layer that doesn't have React dependencies.
- modarts 12y ago> (we use cursors) I'd love to hear some more about the design of your data store: are these cursors basically paths to data? Are they similar to Om's concept of cursors? https://github.com/swannodette/om/wiki/Cursors https://github.com/swannodette/om/wiki/Cursors
- dustingetz 12y agoYes, like Om. Cursor is a read/write view of a subtree of an immutable tree. https://github.com/wingspan/wingspan-cursor/blob/master/js/Cursor.js https://github.com/wingspan/wingspan-cursor/blob/master/js/C...