1.0.4 • Published 5 years ago

core.loader.tree v1.0.4

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

core.loader.tree

load baobab cursor data from plugin definition

related to core.plugin.tree

let core = new require('core.constructor')();
 
core.plugin(
    require('core.plugin.tree'),
    require('core.loader.tree')
);

// plugins can now declare a tree on the plugin definition object:
core.plugin({
    name: 'test',
    tree: {
        a: 1,
        b: {
            c: 7
        }
    }
});

let { test } = core.plugins;

test.get('a'); // 1

test.set('a', 2);

test.get('a'); // 2

let cursor = test.select('b');
cursor.get('c'); // 7
cursor.get('c', 8);

// bind to plugin data inside components
core.Component({
    name: 'Test1',
    get(){
        return {
            render(){
                return test.bind('a', a => <div>{ a }</div>)
            }
        }
    }
});
1.0.4

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago