0.2.0 • Published 9 years ago

handlebars-redux v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 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

9 years ago

0.1.3

9 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago