These are chat archives for reflux/refluxjs

18th
Nov 2015
Mikael Brassman
@spoike
Nov 18 2015 13:39
So I started implementing reducers as an optional thing. It's in PR on reflux-core project. reflux/reflux-core#15
James Gardner
@james-gardner
Nov 18 2015 15:04
Hey, I've got a large number of records and retrieve a handful of filtered records from my REST service (suppose the records are filtered by 'status'). Within the list of records shown through my react component I can change the status of a record. Because the filtering took place server side my component has no way of knowing when to remove items that don't match the filter from its list. Is it the case that you should duplicate the filtering locally as well for effect and somehow store the filter parameters in the store?
yonatan
@yonatanmn
Nov 18 2015 15:16
reducer??? oh my... it will be more complex (and look like redux) - why do we need that? try implementing something like setState() in store - I believe that's much nicer (and will look like react component
James Gardner
@james-gardner
Nov 18 2015 15:27
Nm. Think I got it. I just use connectFilter instead and pass in filter params using props
Mikael Brassman
@spoike
Nov 18 2015 16:23
myesh @yonatanmn :-)
hence optional
which is also optional how you handle state in a store
yonatan
@yonatanmn
Nov 18 2015 17:52
Of course, but... I just think this option should have nicer api - setState({'a': 1}) is ignorant of {b}, while preserving immutability. while in reducers you will have to do the merging yourself. 2. similar API to react 3. no need for extra function (reducer) with it's own folder etc
yonatan
@yonatanmn
Nov 18 2015 17:58
and when you have setState you can start talking in react's language - shouldStoreUpdate(), storeDidUpdate() etc
yonatan
@yonatanmn
Nov 18 2015 18:10
last part of the equation is having a way to connect-to-store-state-change in a component (mixin/decorator) : then you'll have everything redux does, with much cleaner api (no reducers or dispatchers), preserving purity in stores, allowing time travel etc