Skip to content

Plain objects that can have callbacks subscribed to their properties, useful as a basic state machine

License

Notifications You must be signed in to change notification settings

NajuDev/statefulObjects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

statefulObjects

Plain objects that can have callbacks subscribed to their properties.

Usage

var q = statefulObject( { foo : 'bar', widgets : 'doodads' } );

q.foo;    // 'bar'

q.subscribe.foo( 'hello', () => alert(q.foo) );

q.foo = 'blah';   // alerts 'blah'

// to remove callback
q.unsubscribe.foo( 'hello' );

About

Plain objects that can have callbacks subscribed to their properties, useful as a basic state machine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published