Skip to content

I simple functional javascript patterns for stated modules.

Notifications You must be signed in to change notification settings

maxfolley/state-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

state_view.js

A simple functional pattern for setting states.

Usage

var MyView = function (spec) {
    var that = StateView(spec);
    
    that.stateOpen = function () {
    }

    return that;
};

/* 
 * Setting the state invokes the stateOpen function on the view (optional)
 * It also sets a css class on the element, "state-open" so you can do awesome
 * stuff like run css transitions based on states :)
 */
var view = MyView({id: "#test"});
view.setState("open");

About

I simple functional javascript patterns for stated modules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published