An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

# be-promising (🤞) [TODO]

[![NPM version](https://badge.fury.io/js/be-promising.png)](http://badge.fury.io/js/be-promising)
[![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/be-promising?style=for-the-badge)](https://bundlephobia.com/result?p=be-promising)

[![Playwright Tests](https://github.com/bahrus/be-promising/actions/workflows/CI.yml/badge.svg?branch=baseline)](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';
```