1.0.4 • Published 5 years ago

core.plugin.bindings v1.0.4

Weekly downloads
4
License
ISC
Repository
-
Last release
5 years ago

core.plugin.bindings

component bindings for core.tree.

plugin depends on:

installing

npm i core.plugin.bindings

loading

let Core = require('core.constructor');

let core = new Core();

core.plugin([
  require('core.import.create-react-class'),
  require('core.import.prop-types'),
  require('core.import.react'),
  require('core.plugin.tree'),
  require('core.plugin.bindings')
]);

usage

{
    // in some component
    render(){
        return (
            <div>
                { 
                    core.bind(['count'], (count, changeCount) => 
                      <div>      { /* this renders anytime 'count' changes */ }
                          { count }
                          <button onClick={ e => changeCount(count + 1) }>Change</button>
                      </div>
                    )
                }
                
            </div>
        );
    }
}
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago