cerebral-view-inferno

React View layer package for Cerebral


Keywords
react, cerebral, flux, mvc
License
MIT
Install
npm install cerebral-view-inferno@1.1.5

Documentation

cerebral-view-inferno

This module provides first-class component support to Inferno in regards to Cerebral's controller and its state model. Inferno is a much faster library than React or Snabbdom when it comes to rendering to the DOM. Furthermore, it has a JSX Babel Plugin for easy consumption of JSX code.

Install

npm install

Build Example

npm run build-example

Usage

import Inferno from 'inferno';
import { Component, render }  from 'cerebral-view-inferno';
import controller from './controller';

const Widget = Component({
    title: ['widget', 'title'],
    description: ['widget', 'description'],
}, ({ state }) => 
    <section>
        <header>
            <h2>{ state.title }</h2>
        </header>
        <p>{ state.description }</p>
    </section>
);

render(<Widget />, document.body, controller);