0.0.43 • Published 12 months ago

be-scoped v0.0.43

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

be-scoped TODO

Create an EventTarget associated with the adorned element that can hold scoped state.

<div itemscope=💰 id="scoped" 💰='{"count": 30}'>
    <span itemprop=count></span>
    <input type=number 🛗 name=count>
</div>

...results in:

console.log(scoped.💰.count === 30)
//true

If scope.💰 is undefined, it's fine to start setting values into it. They will be absorbed into the scope object when it attaches.

To subscribe to changes to the scope:

scoped.addEventListener.addEventListener('💰.count', e => {
    console.log(e.detail.💰);
});

Adorning a custom element

If the desire is to add "scoping" to a custom element, use be-propagating instead.

Playwright Tests NPM version

Size of package, including custom element behavior framework (be-enhanced/be-hive):

How big is this package in your project?

Size of new code in this package:

Viewing Locally

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  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.

Importing in ES Modules:

import 'be-exportable/be-scoped.js';

Using from CDN:

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

12 months ago

0.0.41

12 months ago

0.0.42

12 months ago

0.0.43

12 months ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

12 months ago

0.0.36

1 year ago

0.0.35

1 year ago

0.0.34

1 year ago

0.0.33

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.30

1 year ago

0.0.29

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.15

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

3 years ago

0.0.0

3 years ago