๐ To inject data into a class method.
yarn add poipoi
npm i -S poipoiimport Poipoi from 'poipoi';
const a = new Poipoi({foo: 'foo'});
a.set({
bar: 'bar',
baz: 'baz'
});
const b = new Poipoi({hoge: 'hoge'});
class Foo {
// somethingMethod(b-obj, a-obj, ...args)
@a.inject('foo', 'baz')
@b.inject('hoge')
somethingMethod({hoge}, {foo, baz}, ...args) {}
}initialValue:Object
value:Object
Overwriting data.
name:String
Get data by name. If it is null, return it all.
Delete all data
name:String
Inject data written in names to the class method.
The MIT License (MIT)
Copyright (c) 2017 nju33 nju33.ki@gmail.com