meiosis-riot

0.7.1 • Public • Published

Meiosis-Riot

Meiosis-Riot is a Meiosis renderer for Riot.

You can install it with npm:

npm i --save meiosis-riot

Then use it along with Meiosis:

import { createComponent, run } from "meiosis";
import { renderer } from "meiosis-riot";
 
const Main = createComponent({
  setup: function(propose/actions) {
    // create Riot components here, use propose or actions in event handlers
  }
});
const model = { store: { ... } };
run(renderer("main-tag-name").intoId(document, "app"), Main);

You can also download the JavaScript file from the Meiosis builds and add it to your page with a plain <script> tag. In that case it will be available as the meiosisRiot global variable.

Create your Riot components in the setup function, and make sure your model has a single root property. In this example, it is store, but you can name it as you wish. Then, specify the name of the root tag of your Riot application when calling renderer(rootTagName).

The Meiosis Guide contains a section about setup explaining its use with Riot.

You will also find a simple counter example and a more elaborate todo-list with server example in the meiosis-examples repository.

--

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

Package Sidebar

Install

npm i meiosis-riot

Weekly Downloads

0

Version

0.7.1

License

MIT

Last publish

Collaborators

  • foxdonut