src/tools.js
function instance(state, methods) {
    let api = {};
    Object.keys(methods).forEach(key => {
        api[key] = methods[key].bind(null, state);
    });
    return api;
}
function instance(state, methods) {
    let api = {};
    Object.keys(methods).forEach(key => {
        api[key] = methods[key].bind(null, state);
    });
    return api;
}
(object, object) => object