Do you need create new actions from action and function?
const { on, action: realar_action } = require('realar');
function action(init, callback) {
const inst = realar_action();
if (callback) {
on(init, (d) => callback(inst, d));
}
return inst;
}
const a = action();
const b = action(a, (next) => {
setTimeout(next, 1000)
});
on(b, () => console.log('to console after 1000ms'));
a();
no comments