Skip to content

Instantly share code, notes, and snippets.

@mharris717
Created June 1, 2018 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharris717/41d050e6534196b0fd681a551d5deee6 to your computer and use it in GitHub Desktop.
Save mharris717/41d050e6534196b0fd681a551d5deee6 to your computer and use it in GitHub Desktop.
Microstates are the real Good News

Create immutable state from a Class and get the best parts of an ORM for free. When I started with Redux I googled "Redux ORM" and immediately recoiled in horror. I just wanted to automate the translation between my state primitive and real classes. This gets it as a freaking byproduct.

Common primitives available on anything in microstate with no boilerplate. Uniform expression of these primitives makes translation to other forms easy.

Set nested properties in a consistent way without feeling like you're splitting the atom each time you need to do it. All (most of?) the operations just continue to work within Arrays.

Composable!!! Chainable!!! Constants!!!

Computed properties and transitions just fall out so naturally from using classes that it doesn't even seem like you did anything. Transitions take the place of many action creators in an obvious way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment