jmreidy / fluxy

An implementation of Facebook's Flux architecture
232 stars 19 forks source link

Add Store.setFromJS to mirror Store.getAsJS #9

Closed nicolashery closed 10 years ago

nicolashery commented 10 years ago

I tripped over this, somewhere in a Store I was doing this.set('user', user), but the user object was from an action's payload and was just plain JS. However, when reading the store object I was expecting to get CLJ back. This is fixed, but now my stores have a lot of code like:

this.set('user', $.js_to_clj(user));

I wonder if there should be a Store.setFromJS helper? To mirror Store.getAsJS? The above snippet would then look like:

this.setFromJS('user', user);