0.2.0 • Published 8 years ago

handlebars-redux v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

handlebars-redux

handlebars-redux is a framework to connect a handlebars component to the redux lifecycle. An example application using handlebars-redux can be found here. This package is composed of:

connect

This method takes a store parameter (created when you call createStore from redux) and a HandlebarsComponent. All state changes are passed through this root component to all child components.

registerComponents

This expects two parameters. First, this needs to be provided the Handlebars runtime (tested w/ handlebars/runtime and hbsfy/runtime). Second, this expects a list of components that are referenced by the root component.

HandlebarsComponent

Extend this class to enable managing state changes. At a minimum, this class should look something like...

'use strict';

import template from './../templates/template.hbs';
import { HandlebarsComponent } from 'handlebars-redux';

class Component extends HandlebarsComponent
{
    constructor(el)
    {
        super();
        this.view = template;
        this.init(el);
    }
}

export default Component;

The information specified in your reducer will be passed into this component and can be accessed in the .hbs template file as {{props.somePieceOfState}}. These components roughly follow the react lifecycle.

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago