https://github.com/bahrus/be-promising
Apply multiple custom enhancements in a proscribed order.
https://github.com/bahrus/be-promising
Last synced: 5 months ago
JSON representation
Apply multiple custom enhancements in a proscribed order.
- Host: GitHub
- URL: https://github.com/bahrus/be-promising
- Owner: bahrus
- License: mit
- Created: 2022-08-27T13:03:11.000Z (almost 3 years ago)
- Default Branch: baseline
- Last Pushed: 2024-12-05T02:13:36.000Z (6 months ago)
- Last Synced: 2024-12-05T02:26:58.460Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 388 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# be-promising (🤞) [TODO]
[](http://badge.fury.io/js/be-promising)
[](https://bundlephobia.com/result?p=be-promising)![]()
[](https://github.com/bahrus/be-promising/actions/workflows/CI.yml)## Applying multiple enhancements in a proscribed order.
[be-enhanced](https://github.com/bahrus/be-enhanced) [be-hiviors](https://github.com/bahrus/be-hive) 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.
```html
[Specify Name]```
or
```html
[Specify Name]
```Idea influenced by [this discussion](https://twitter.com/dan_abramov/status/1563307506482696192).
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:
```html
import 'https://esm.run/be-promising';
```
## Referencing via ESM Modules:
```JavaScript
import 'be-promising/be-promising.js';
```