Many of my flux stores manage collections and I find myself repeating a lot of boilerplate code for finding / updating / removing objects. In an effort to avoid pulling in something like ampersand-collection, I was hoping to use immutable.js to cut down on some of the duplication but I'm having a hard time wrapping my head around immutability. It actually feels wrong to be using immutable data within the stores since a store's primary job is to mutate data. I must be doing something wrong.
Anyone have some complex stores backed by immutable data structures they could share?
1 comment
[ 4.4 ms ] story [ 12.1 ms ] threadMany of my flux stores manage collections and I find myself repeating a lot of boilerplate code for finding / updating / removing objects. In an effort to avoid pulling in something like ampersand-collection, I was hoping to use immutable.js to cut down on some of the duplication but I'm having a hard time wrapping my head around immutability. It actually feels wrong to be using immutable data within the stores since a store's primary job is to mutate data. I must be doing something wrong.
Anyone have some complex stores backed by immutable data structures they could share?