@airb/onion

onion events processor

Usage no npm install needed!

<script type="module">
  import airbOnion from 'https://cdn.skypack.dev/@airb/onion';
</script>

README

onion

Create action object for javascript

Install

$ yarn add @airb/onion

Usage

import onion from '@airb/onion';

let context = {},
    ob = onion(content);

// add action
ob.add({
    action(a, b) {
        return this.next(a + b, 1) || a + b;
    }
});

// tap action
ob.tap('action', 1, 2);

// bind actions
let proxy = ob.bind(['action']);

// invoke action
proxy.action(1, 2);