Skip to content

Apply multiple custom enhancements in a proscribed order.

License

Notifications You must be signed in to change notification settings

bahrus/be-promising

Repository files navigation

be-promising (🤞) [TODO]

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

Applying multiple enhancements in a proscribed order.

be-enhanced be-hiviors provide the ability to apply multiple cross-cutting enhancements to a single element. Sometimes, though, we need to apply them in a particular order.

be-promising provides this capability.

<label 
    be-typed
    defer-be-clonable
    be-clonable
    defer-be-delible
    be-delible
    be-promising='be-typed be-clonable be-delible'>[Specify Name]
</label>

or

<label ⚙️ defer-⿻  defer-⌫  🤞="⚙️ ⿻ ⌫">[Specify Name]</label>

Idea influenced by this discussion.

What this does:

  1. Looks for be-hive tag, finds corresponding mount observer script elements (MOSEs)
  2. In the sequence specified in the attribute:
    1. If applicable, removes the defer-[base] attribute
    2. From the MOSE, gets the emc for that attribute
    3. Awaits *.whenResolved
    4. Rinse and repeat

Running locally

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

  1. Install git.
  2. Do a git clone or a git fork of repository https://github.com/bahrus/be-promising
  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.

Using from CDN:

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

Referencing via ESM Modules:

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

About

Apply multiple custom enhancements in a proscribed order.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published