It's not a library. It's a simple pattern to manage state in your web applications.
Think Redux, MobX, Cerebral, React Context, etc. but without having library imports everywhere and being tied to a framework API. Instead, just plain functions and objects.
All you need is a simple stream library such as Flyd or Mithril Stream in one place to implement the pattern. You do not need anything else, not even Meiosis itself. You could even implement the stream yourself with a handful of lines of code. Zero dependencies!
Easily use the pattern with your favourite view library: React, Preact, Mithril, lit-html, and so on.
Ready to have a closer look?
→ Read the Meiosis tutorial to get started.
→ Read the Documentation to learn more techniques.
Ready for More?
Why the name Meiosis?
I picked the name Meiosis for three reasons:
- it's a biology term for a type of cell division; this is an analogy to the idea of dividing your application into smaller pieces;
- it's a figure of speech that intentionally understates something or implies that it is lesser in significance or size than it really is, meaning that this is meant to be small, humble, and not replace what people use, just improve upon it; and
Meiosis is the result of a whole adventure of exploring other architectures. Credit goes to their authors; I am grateful for their work and that of their respective communities.
- Mithril and its fantastic community. Special thanks to James Forbes, Barney Carroll, Stefan Thon, Rasmus Porsager, Devin Ivy, Scotty Simpson, Daniel Loomer, and many others, for all their help, sharing their knowledge, and discussing ideas!
- CycleJS driven by state by Christian Alfoni. This article was very inspirational to me and I am very grateful to Christian! I also find Christian's other projects very interesting, including (but not limited to) Cerebral and function-tree.
- The SAM pattern by Jean-Jacques Dubray. There are some very sound principles to the SAM pattern, and I very much appreciate discussing and learning from Jean-Jacques as he is always gracious and willing to share his knowledge and experience.
- Simon Friis Vindum, creator of Flyd, Snabbdom, and others. I use Flyd as a stream library for Meiosis.
- hyperapp, by Jorge Bucaran.
Meiosis is developed by foxdonut (@foxdonut00) and is released under the MIT license.