It's what you already love, only better.

Do you Mei-O?

Meiosis is a library and an architecture pattern for dividing a web application into small, independent, manageable, and testable parts, while letting you keep using the tools that you already love. Meiosis manages the data flow and lets you choose whatever you like for rendering views.

For example, you can use React, Inferno, Snabbdom, Mithril, jQuery, Handlebars, or no libraries at all and just plain vanilla JavaScript.

Meiosis implements the SAM pattern by Jean-Jacques Dubray.

Developing a web application with Meiosis involves three simple concepts:

  1. Start with a model. This is the single source of truth. It can be a plain JavaScript object. Whether it is mutable or immutable is up to you. Optionally, write a state function that takes the model and computes additional properties to produce the complete application state.
  2. Write the view as a function of the model/application state.
  3. Have a way to propose changes to the model. After the changes have been accepted, Meiosis re-renders the view by calling the view function with the new model/application state.

Meiosis is a small, simple library with no dependencies. It helps you build components with minimal effort, providing an architecture to structure your code that scales well as your application gets larger and more complex.

You choose what you like to use for creating views. Meiosis organizes how the data flows in your application by:

Meiosis is about managing the application data flow. Create components by specifying functions, and Meiosis takes care of the wiring. Every part of the process is optional, so you can specify what you need for each component.

For documentation please refer to the Meiosis Guide.

Try out the examples online:

Example code:

Please post questions and suggestions as Github issues on the meiosis repository.

You can also chat on the Gitter channel.

Why the name Meiosis?

I picked the name Meiosis for three reasons:

  1. 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;
  2. 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 library is meant to be small, humble, and not replace what people use, just improve upon it; and
  3. it's a relatively unique name in the JavaScript world, thus making it easy to find information using search engines.

Meiosis is developed by foxdonut (@foxdonut00) and is released under the MIT license.