0.0.2 • Published 7 months ago

be-invoking v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

be-invoking

Invoke method on upstream peer element or the host.

NPM version How big is this package in your project? Playwright Tests

Example 1a

<my-custom-element>
    #shadow
        <input disabled be-invoking='of do something.'>
</my-custom-element>

What this does: Invokes host-element's doSomething method only when the input element dispatches "input" event.

To specify a different event:

Example 1b

<host-element>
    #shadow
        <input be-invoking='of do something on change.'>
</host-element>

Example 2

<host-element>
    #shadow
        <peer-element -my-method></peer-element>
        <input be-invoking='of -my-method.'>
</host-element>

Viewing Demos Locally

Any web server that can serve static files will do, but...

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.js.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:3030/demo/ in a modern browser.

Running Tests

> npm run test

Using from ESM Module:

import 'be-invoking/be-invoking.js';

Using from CDN:

<script type=module crossorigin=anonymous>
    import 'https://esm.run/be-invoking';
</script>