mount-observer 0.0.62 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Newish.js CHANGED
@@ -2,6 +2,7 @@ export { waitForEvent } from './waitForEvent.js';
2
2
  import { ObsAttr } from './ObsAttr.js';
3
3
  import { splitRefs } from './refid/splitRefs.js';
4
4
  import { getIsh } from './refid/getIsh.js';
5
+ import { sym } from './refid/regIsh.js';
5
6
  export const attached = Symbol.for('xyyspnstnU+CDrNVa0VnxA');
6
7
  export class Newish {
7
8
  queue = [];
@@ -96,8 +97,9 @@ export class Newish {
96
97
  while (this.queue.length > 0) {
97
98
  const fi = this.queue.shift();
98
99
  //TODO: Provide support for a virtual slice of a very large list
100
+ //TODO: Maybe should check if iterable rather than an array?
99
101
  if (Array.isArray(fi)) {
100
- ce.ishList = fi;
102
+ ce[sym] = fi;
101
103
  actions.add('ishListAssigned');
102
104
  }
103
105
  else {
package/Newish.ts CHANGED
@@ -4,6 +4,7 @@ export {waitForEvent} from './waitForEvent.js';
4
4
  import {ObsAttr} from './ObsAttr.js';
5
5
  import {splitRefs} from './refid/splitRefs.js';
6
6
  import {getIsh} from './refid/getIsh.js';
7
+ import {sym} from './refid/regIsh.js';
7
8
  export const attached = Symbol.for('xyyspnstnU+CDrNVa0VnxA');
8
9
  export class Newish implements EventListenerObject {
9
10
  queue: Array<any> = [];
@@ -112,8 +113,9 @@ export class Newish implements EventListenerObject {
112
113
  while(this.queue.length > 0 ){
113
114
  const fi = this.queue.shift();
114
115
  //TODO: Provide support for a virtual slice of a very large list
116
+ //TODO: Maybe should check if iterable rather than an array?
115
117
  if(Array.isArray(fi)){
116
- (<any>ce).ishList = fi;
118
+ (<any>ce)[sym] = fi;
117
119
  actions.add('ishListAssigned');
118
120
  }else{
119
121
  const {assigner} = this.#options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
package/refid/regIsh.js CHANGED
@@ -10,5 +10,17 @@ export function regIsh(scope, name, ctr) {
10
10
  throw 403;
11
11
  }
12
12
  map.set(name, ctr);
13
+ ctr.prototype[Symbol.iterator] = function () {
14
+ var index = -1;
15
+ var data = this[sym];
16
+ return {
17
+ next: function () {
18
+ return {
19
+ value: data === undefined ? undefined : data[++index],
20
+ done: data === undefined || !(index in data)
21
+ };
22
+ }
23
+ };
24
+ };
13
25
  document.dispatchEvent(new Event(guid));
14
26
  }
package/refid/regIsh.ts CHANGED
@@ -12,5 +12,18 @@ export function regIsh(scope: Element | ShadowRoot | Document, name: string, ctr
12
12
  throw 403;
13
13
  }
14
14
  map.set(name, ctr);
15
+ ctr.prototype[Symbol.iterator] = function() {
16
+ var index = -1;
17
+ var data = this[sym];
18
+
19
+ return {
20
+ next: function() {
21
+ return {
22
+ value: data === undefined ? undefined : data[++index],
23
+ done: data === undefined || !(index in data)
24
+ }
25
+ }
26
+ };
27
+ };
15
28
  document.dispatchEvent(new Event(guid));
16
29
  }