mol_wire_pub 0.0.1 → 1.0.0

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/node.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/fail/fail.ts","mol/wire/cursor/cursor.ts","mol/wire/pub/pub.ts","mol/wire/sub/sub.ts","mol/wire/README.md","mol/wire/wire.ts"],"mods":{},"deps_in":{"mol/wire":{},"mol":{"mol/wire":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/wire/sub":{"mol/wire":-1},"mol/wire/pub":{"mol/wire/sub":-1},"mol/fail":{"mol/wire/pub":-4},"mol/wire/cursor":{"mol/wire/pub":-3}},"deps_out":{"mol/wire/pub":{"mol/fail":-4,"mol/wire/cursor":-3},"mol/wire":{"mol":-9007199254740991,"mol/wire/sub":-1},"mol":{"":-9007199254740991},"mol/wire/sub":{"mol/wire/pub":-1},"mol/fail":{"mol":-9007199254740991},"mol/wire/cursor":{}},"sloc":{"LICENSE":113,"md":538,"tree":31,"js":10,"ts":180,"json":86,"lock":927,"CNAME":1,"html":1},"deps":{"mol/wire/pub":{"..":-9007199254740991,"/mol/wire/pub":-1,"/mol/wire/sub":-3,"/mol/fail":-4,"/mol/wire/auto":-3,"/mol/wire/cursor/stale":-3,"/mol/wire/affected/length":-3,"/mol/wire/affected/pop":-4,"/mol/wire/cursor/doubt":-4,"/mol/wire/affected/push":-4},"mol/wire":{"..":-9007199254740991,"/mol/wire/auto":-1,"/mol/wire/sub":-1,"/mol/wire/affected":-1},"mol":{"..":-9007199254740991},"":{},"mol/wire/sub":{"..":-9007199254740991,"/mol/wire/sub":-1,"/mol/wire/pub":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/wire/cursor":{"..":-9007199254740991,"/mol/wire/cursor":-1}}}
1
+ {"files":["lang.lang.tree","LICENSE","mam.jam.js","mam.ts","package.json","README.md","sandbox.config.json","tsconfig.json","tsfmt.json","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/index.html","mol/LICENSE","mol/mol.meta.tree","mol/readme.md","mol/fail/fail.ts","mol/wire/cursor/cursor.ts","mol/wire/pub/pub.ts","mol/wire/sub/sub.ts","mol/wire/README.md","mol/wire/wire.ts"],"mods":{},"deps_in":{"mol/wire":{},"mol":{"mol/wire":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/wire/sub":{"mol/wire":-1},"mol/wire/pub":{"mol/wire/sub":-1},"mol/fail":{"mol/wire/pub":-4},"mol/wire/cursor":{"mol/wire/pub":-3}},"deps_out":{"mol/wire/pub":{"mol/fail":-4,"mol/wire/cursor":-3},"mol/wire":{"mol":-9007199254740991,"mol/wire/sub":-1},"mol":{"":-9007199254740991},"mol/wire/sub":{"mol/wire/pub":-1},"mol/fail":{"mol":-9007199254740991},"mol/wire/cursor":{}},"sloc":{"tree":31,"LICENSE":113,"js":10,"ts":180,"json":84,"md":515,"CNAME":1,"html":1},"deps":{"mol/wire/pub":{"..":-9007199254740991,"/mol/wire/pub":-1,"/mol/wire/sub":-3,"/mol/fail":-4,"/mol/wire/auto":-3,"/mol/wire/cursor/stale":-3,"/mol/wire/affected/length":-3,"/mol/wire/affected/pop":-4,"/mol/wire/cursor/doubt":-4,"/mol/wire/affected/push":-4},"mol/wire":{"..":-9007199254740991,"/mol/wire/auto":-1,"/mol/wire/sub":-1,"/mol/wire/affected":-1},"mol":{"..":-9007199254740991},"":{},"mol/wire/sub":{"..":-9007199254740991,"/mol/wire/sub":-1,"/mol/wire/pub":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/wire/cursor":{"..":-9007199254740991,"/mol/wire/cursor":-1}}}
package/node.esm.js CHANGED
@@ -18,132 +18,132 @@ $.$$ = $
18
18
  var $node = $node || {}
19
19
  void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
20
20
  ;
21
- "use strict";
22
- Error.stackTraceLimit = 50;
23
- var $;
24
- (function ($) {
25
- })($ || ($ = {}));
26
- module.exports = $;
21
+ "use strict";
22
+ Error.stackTraceLimit = 50;
23
+ var $;
24
+ (function ($) {
25
+ })($ || ($ = {}));
26
+ module.exports = $;
27
27
  //mam.ts
28
28
  ;
29
29
 
30
30
  $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
31
31
  ;
32
- "use strict";
33
- var $;
34
- (function ($) {
35
- function $mol_fail(error) {
36
- throw error;
37
- }
38
- $.$mol_fail = $mol_fail;
39
- })($ || ($ = {}));
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ function $mol_fail(error) {
36
+ throw error;
37
+ }
38
+ $.$mol_fail = $mol_fail;
39
+ })($ || ($ = {}));
40
40
  //mol/fail/fail.ts
41
41
  ;
42
- "use strict";
43
- var $;
44
- (function ($) {
45
- let $mol_wire_cursor;
46
- (function ($mol_wire_cursor) {
47
- $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
- })(-1)] = "stale";
49
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
- })(-2)] = "doubt";
51
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
- })(-3)] = "fresh";
53
- $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
- })(-4)] = "final";
55
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
- })($ || ($ = {}));
42
+ "use strict";
43
+ var $;
44
+ (function ($) {
45
+ let $mol_wire_cursor;
46
+ (function ($mol_wire_cursor) {
47
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
+ })(-1)] = "stale";
49
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
+ })(-2)] = "doubt";
51
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
+ })(-3)] = "fresh";
53
+ $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
+ })(-4)] = "final";
55
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
+ })($ || ($ = {}));
57
57
  //mol/wire/cursor/cursor.ts
58
58
  ;
59
- "use strict";
60
- var $;
61
- (function ($) {
62
- class $mol_wire_pub extends Array {
63
- static get [Symbol.species]() {
64
- return Array;
65
- }
66
- sub_from = 0;
67
- get sub_list() {
68
- const res = [];
69
- for (let i = this.sub_from; i < this.length; i += 2) {
70
- res.push(this[i]);
71
- }
72
- return res;
73
- }
74
- get sub_empty() {
75
- return this.sub_from === this.length;
76
- }
77
- sub_on(sub, pub_pos) {
78
- const pos = this.length;
79
- this.push(sub, pub_pos);
80
- return pos;
81
- }
82
- sub_off(sub_pos) {
83
- if (!(sub_pos < this.length)) {
84
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
- }
86
- const end = this.length - 2;
87
- if (sub_pos !== end) {
88
- this.peer_move(end, sub_pos);
89
- }
90
- this.pop();
91
- this.pop();
92
- if (this.length === this.sub_from)
93
- this.reap();
94
- }
95
- reap() { }
96
- track_promote() {
97
- $mol_wire_auto?.track_next(this);
98
- }
99
- up() { }
100
- down() { }
101
- emit() {
102
- for (let i = this.sub_from; i < this.length; i += 2) {
103
- ;
104
- this[i].stale();
105
- }
106
- }
107
- stale() {
108
- if (!this.affect($mol_wire_cursor.stale))
109
- return false;
110
- while ($mol_wire_affected.length) {
111
- const next = $mol_wire_affected.pop();
112
- next.affect($mol_wire_cursor.doubt);
113
- }
114
- return true;
115
- }
116
- affect(quant) {
117
- for (let i = this.sub_from; i < this.length; i += 2) {
118
- const sub = this[i];
119
- $mol_wire_affected.push(sub);
120
- }
121
- return true;
122
- }
123
- peer_move(from_pos, to_pos) {
124
- const peer = this[from_pos];
125
- const self_pos = this[from_pos + 1];
126
- this[to_pos] = peer;
127
- this[to_pos + 1] = self_pos;
128
- peer.peer_repos(self_pos, to_pos);
129
- }
130
- peer_repos(peer_pos, self_pos) {
131
- this[peer_pos + 1] = self_pos;
132
- }
133
- }
134
- $.$mol_wire_pub = $mol_wire_pub;
135
- })($ || ($ = {}));
59
+ "use strict";
60
+ var $;
61
+ (function ($) {
62
+ class $mol_wire_pub extends Array {
63
+ static get [Symbol.species]() {
64
+ return Array;
65
+ }
66
+ sub_from = 0;
67
+ get sub_list() {
68
+ const res = [];
69
+ for (let i = this.sub_from; i < this.length; i += 2) {
70
+ res.push(this[i]);
71
+ }
72
+ return res;
73
+ }
74
+ get sub_empty() {
75
+ return this.sub_from === this.length;
76
+ }
77
+ sub_on(sub, pub_pos) {
78
+ const pos = this.length;
79
+ this.push(sub, pub_pos);
80
+ return pos;
81
+ }
82
+ sub_off(sub_pos) {
83
+ if (!(sub_pos < this.length)) {
84
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
+ }
86
+ const end = this.length - 2;
87
+ if (sub_pos !== end) {
88
+ this.peer_move(end, sub_pos);
89
+ }
90
+ this.pop();
91
+ this.pop();
92
+ if (this.length === this.sub_from)
93
+ this.reap();
94
+ }
95
+ reap() { }
96
+ track_promote() {
97
+ $mol_wire_auto?.track_next(this);
98
+ }
99
+ up() { }
100
+ down() { }
101
+ emit() {
102
+ for (let i = this.sub_from; i < this.length; i += 2) {
103
+ ;
104
+ this[i].stale();
105
+ }
106
+ }
107
+ stale() {
108
+ if (!this.affect($mol_wire_cursor.stale))
109
+ return false;
110
+ while ($mol_wire_affected.length) {
111
+ const next = $mol_wire_affected.pop();
112
+ next.affect($mol_wire_cursor.doubt);
113
+ }
114
+ return true;
115
+ }
116
+ affect(quant) {
117
+ for (let i = this.sub_from; i < this.length; i += 2) {
118
+ const sub = this[i];
119
+ $mol_wire_affected.push(sub);
120
+ }
121
+ return true;
122
+ }
123
+ peer_move(from_pos, to_pos) {
124
+ const peer = this[from_pos];
125
+ const self_pos = this[from_pos + 1];
126
+ this[to_pos] = peer;
127
+ this[to_pos + 1] = self_pos;
128
+ peer.peer_repos(self_pos, to_pos);
129
+ }
130
+ peer_repos(peer_pos, self_pos) {
131
+ this[peer_pos + 1] = self_pos;
132
+ }
133
+ }
134
+ $.$mol_wire_pub = $mol_wire_pub;
135
+ })($ || ($ = {}));
136
136
  //mol/wire/pub/pub.ts
137
137
  ;
138
- "use strict";
138
+ "use strict";
139
139
  //mol/wire/sub/sub.ts
140
140
  ;
141
- "use strict";
142
- var $;
143
- (function ($) {
144
- $.$mol_wire_auto = null;
145
- $.$mol_wire_affected = [];
146
- })($ || ($ = {}));
141
+ "use strict";
142
+ var $;
143
+ (function ($) {
144
+ $.$mol_wire_auto = null;
145
+ $.$mol_wire_affected = [];
146
+ })($ || ($ = {}));
147
147
  //mol/wire/wire.ts
148
148
  ;
149
149
  export default $
package/node.js CHANGED
@@ -18,132 +18,132 @@ $.$$ = $
18
18
  var $node = $node || {}
19
19
  void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
20
20
  ;
21
- "use strict";
22
- Error.stackTraceLimit = 50;
23
- var $;
24
- (function ($) {
25
- })($ || ($ = {}));
26
- module.exports = $;
21
+ "use strict";
22
+ Error.stackTraceLimit = 50;
23
+ var $;
24
+ (function ($) {
25
+ })($ || ($ = {}));
26
+ module.exports = $;
27
27
  //mam.ts
28
28
  ;
29
29
 
30
30
  $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
31
31
  ;
32
- "use strict";
33
- var $;
34
- (function ($) {
35
- function $mol_fail(error) {
36
- throw error;
37
- }
38
- $.$mol_fail = $mol_fail;
39
- })($ || ($ = {}));
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ function $mol_fail(error) {
36
+ throw error;
37
+ }
38
+ $.$mol_fail = $mol_fail;
39
+ })($ || ($ = {}));
40
40
  //mol/fail/fail.ts
41
41
  ;
42
- "use strict";
43
- var $;
44
- (function ($) {
45
- let $mol_wire_cursor;
46
- (function ($mol_wire_cursor) {
47
- $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
- })(-1)] = "stale";
49
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
- })(-2)] = "doubt";
51
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
- })(-3)] = "fresh";
53
- $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
- })(-4)] = "final";
55
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
- })($ || ($ = {}));
42
+ "use strict";
43
+ var $;
44
+ (function ($) {
45
+ let $mol_wire_cursor;
46
+ (function ($mol_wire_cursor) {
47
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
+ })(-1)] = "stale";
49
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
+ })(-2)] = "doubt";
51
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
+ })(-3)] = "fresh";
53
+ $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
+ })(-4)] = "final";
55
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
+ })($ || ($ = {}));
57
57
  //mol/wire/cursor/cursor.ts
58
58
  ;
59
- "use strict";
60
- var $;
61
- (function ($) {
62
- class $mol_wire_pub extends Array {
63
- static get [Symbol.species]() {
64
- return Array;
65
- }
66
- sub_from = 0;
67
- get sub_list() {
68
- const res = [];
69
- for (let i = this.sub_from; i < this.length; i += 2) {
70
- res.push(this[i]);
71
- }
72
- return res;
73
- }
74
- get sub_empty() {
75
- return this.sub_from === this.length;
76
- }
77
- sub_on(sub, pub_pos) {
78
- const pos = this.length;
79
- this.push(sub, pub_pos);
80
- return pos;
81
- }
82
- sub_off(sub_pos) {
83
- if (!(sub_pos < this.length)) {
84
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
- }
86
- const end = this.length - 2;
87
- if (sub_pos !== end) {
88
- this.peer_move(end, sub_pos);
89
- }
90
- this.pop();
91
- this.pop();
92
- if (this.length === this.sub_from)
93
- this.reap();
94
- }
95
- reap() { }
96
- track_promote() {
97
- $mol_wire_auto?.track_next(this);
98
- }
99
- up() { }
100
- down() { }
101
- emit() {
102
- for (let i = this.sub_from; i < this.length; i += 2) {
103
- ;
104
- this[i].stale();
105
- }
106
- }
107
- stale() {
108
- if (!this.affect($mol_wire_cursor.stale))
109
- return false;
110
- while ($mol_wire_affected.length) {
111
- const next = $mol_wire_affected.pop();
112
- next.affect($mol_wire_cursor.doubt);
113
- }
114
- return true;
115
- }
116
- affect(quant) {
117
- for (let i = this.sub_from; i < this.length; i += 2) {
118
- const sub = this[i];
119
- $mol_wire_affected.push(sub);
120
- }
121
- return true;
122
- }
123
- peer_move(from_pos, to_pos) {
124
- const peer = this[from_pos];
125
- const self_pos = this[from_pos + 1];
126
- this[to_pos] = peer;
127
- this[to_pos + 1] = self_pos;
128
- peer.peer_repos(self_pos, to_pos);
129
- }
130
- peer_repos(peer_pos, self_pos) {
131
- this[peer_pos + 1] = self_pos;
132
- }
133
- }
134
- $.$mol_wire_pub = $mol_wire_pub;
135
- })($ || ($ = {}));
59
+ "use strict";
60
+ var $;
61
+ (function ($) {
62
+ class $mol_wire_pub extends Array {
63
+ static get [Symbol.species]() {
64
+ return Array;
65
+ }
66
+ sub_from = 0;
67
+ get sub_list() {
68
+ const res = [];
69
+ for (let i = this.sub_from; i < this.length; i += 2) {
70
+ res.push(this[i]);
71
+ }
72
+ return res;
73
+ }
74
+ get sub_empty() {
75
+ return this.sub_from === this.length;
76
+ }
77
+ sub_on(sub, pub_pos) {
78
+ const pos = this.length;
79
+ this.push(sub, pub_pos);
80
+ return pos;
81
+ }
82
+ sub_off(sub_pos) {
83
+ if (!(sub_pos < this.length)) {
84
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
+ }
86
+ const end = this.length - 2;
87
+ if (sub_pos !== end) {
88
+ this.peer_move(end, sub_pos);
89
+ }
90
+ this.pop();
91
+ this.pop();
92
+ if (this.length === this.sub_from)
93
+ this.reap();
94
+ }
95
+ reap() { }
96
+ track_promote() {
97
+ $mol_wire_auto?.track_next(this);
98
+ }
99
+ up() { }
100
+ down() { }
101
+ emit() {
102
+ for (let i = this.sub_from; i < this.length; i += 2) {
103
+ ;
104
+ this[i].stale();
105
+ }
106
+ }
107
+ stale() {
108
+ if (!this.affect($mol_wire_cursor.stale))
109
+ return false;
110
+ while ($mol_wire_affected.length) {
111
+ const next = $mol_wire_affected.pop();
112
+ next.affect($mol_wire_cursor.doubt);
113
+ }
114
+ return true;
115
+ }
116
+ affect(quant) {
117
+ for (let i = this.sub_from; i < this.length; i += 2) {
118
+ const sub = this[i];
119
+ $mol_wire_affected.push(sub);
120
+ }
121
+ return true;
122
+ }
123
+ peer_move(from_pos, to_pos) {
124
+ const peer = this[from_pos];
125
+ const self_pos = this[from_pos + 1];
126
+ this[to_pos] = peer;
127
+ this[to_pos + 1] = self_pos;
128
+ peer.peer_repos(self_pos, to_pos);
129
+ }
130
+ peer_repos(peer_pos, self_pos) {
131
+ this[peer_pos + 1] = self_pos;
132
+ }
133
+ }
134
+ $.$mol_wire_pub = $mol_wire_pub;
135
+ })($ || ($ = {}));
136
136
  //mol/wire/pub/pub.ts
137
137
  ;
138
- "use strict";
138
+ "use strict";
139
139
  //mol/wire/sub/sub.ts
140
140
  ;
141
- "use strict";
142
- var $;
143
- (function ($) {
144
- $.$mol_wire_auto = null;
145
- $.$mol_wire_affected = [];
146
- })($ || ($ = {}));
141
+ "use strict";
142
+ var $;
143
+ (function ($) {
144
+ $.$mol_wire_auto = null;
145
+ $.$mol_wire_affected = [];
146
+ })($ || ($ = {}));
147
147
  //mol/wire/wire.ts
148
148
 
149
149
  //# sourceMappingURL=node.js.map
package/node.test.js CHANGED
@@ -13,129 +13,129 @@ var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) :
13
13
  $.$$ = $
14
14
 
15
15
  ;
16
- "use strict";
17
- Error.stackTraceLimit = 50;
18
- var $;
19
- (function ($) {
20
- })($ || ($ = {}));
21
- module.exports = $;
16
+ "use strict";
17
+ Error.stackTraceLimit = 50;
18
+ var $;
19
+ (function ($) {
20
+ })($ || ($ = {}));
21
+ module.exports = $;
22
22
  //mam.ts
23
23
  ;
24
- "use strict";
25
- var $;
26
- (function ($) {
27
- function $mol_fail(error) {
28
- throw error;
29
- }
30
- $.$mol_fail = $mol_fail;
31
- })($ || ($ = {}));
24
+ "use strict";
25
+ var $;
26
+ (function ($) {
27
+ function $mol_fail(error) {
28
+ throw error;
29
+ }
30
+ $.$mol_fail = $mol_fail;
31
+ })($ || ($ = {}));
32
32
  //mol/fail/fail.ts
33
33
  ;
34
- "use strict";
35
- var $;
36
- (function ($) {
37
- let $mol_wire_cursor;
38
- (function ($mol_wire_cursor) {
39
- $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
40
- })(-1)] = "stale";
41
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
42
- })(-2)] = "doubt";
43
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
44
- })(-3)] = "fresh";
45
- $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
46
- })(-4)] = "final";
47
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
48
- })($ || ($ = {}));
34
+ "use strict";
35
+ var $;
36
+ (function ($) {
37
+ let $mol_wire_cursor;
38
+ (function ($mol_wire_cursor) {
39
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
40
+ })(-1)] = "stale";
41
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
42
+ })(-2)] = "doubt";
43
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
44
+ })(-3)] = "fresh";
45
+ $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
46
+ })(-4)] = "final";
47
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
48
+ })($ || ($ = {}));
49
49
  //mol/wire/cursor/cursor.ts
50
50
  ;
51
- "use strict";
52
- var $;
53
- (function ($) {
54
- class $mol_wire_pub extends Array {
55
- static get [Symbol.species]() {
56
- return Array;
57
- }
58
- sub_from = 0;
59
- get sub_list() {
60
- const res = [];
61
- for (let i = this.sub_from; i < this.length; i += 2) {
62
- res.push(this[i]);
63
- }
64
- return res;
65
- }
66
- get sub_empty() {
67
- return this.sub_from === this.length;
68
- }
69
- sub_on(sub, pub_pos) {
70
- const pos = this.length;
71
- this.push(sub, pub_pos);
72
- return pos;
73
- }
74
- sub_off(sub_pos) {
75
- if (!(sub_pos < this.length)) {
76
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
77
- }
78
- const end = this.length - 2;
79
- if (sub_pos !== end) {
80
- this.peer_move(end, sub_pos);
81
- }
82
- this.pop();
83
- this.pop();
84
- if (this.length === this.sub_from)
85
- this.reap();
86
- }
87
- reap() { }
88
- track_promote() {
89
- $mol_wire_auto?.track_next(this);
90
- }
91
- up() { }
92
- down() { }
93
- emit() {
94
- for (let i = this.sub_from; i < this.length; i += 2) {
95
- ;
96
- this[i].stale();
97
- }
98
- }
99
- stale() {
100
- if (!this.affect($mol_wire_cursor.stale))
101
- return false;
102
- while ($mol_wire_affected.length) {
103
- const next = $mol_wire_affected.pop();
104
- next.affect($mol_wire_cursor.doubt);
105
- }
106
- return true;
107
- }
108
- affect(quant) {
109
- for (let i = this.sub_from; i < this.length; i += 2) {
110
- const sub = this[i];
111
- $mol_wire_affected.push(sub);
112
- }
113
- return true;
114
- }
115
- peer_move(from_pos, to_pos) {
116
- const peer = this[from_pos];
117
- const self_pos = this[from_pos + 1];
118
- this[to_pos] = peer;
119
- this[to_pos + 1] = self_pos;
120
- peer.peer_repos(self_pos, to_pos);
121
- }
122
- peer_repos(peer_pos, self_pos) {
123
- this[peer_pos + 1] = self_pos;
124
- }
125
- }
126
- $.$mol_wire_pub = $mol_wire_pub;
127
- })($ || ($ = {}));
51
+ "use strict";
52
+ var $;
53
+ (function ($) {
54
+ class $mol_wire_pub extends Array {
55
+ static get [Symbol.species]() {
56
+ return Array;
57
+ }
58
+ sub_from = 0;
59
+ get sub_list() {
60
+ const res = [];
61
+ for (let i = this.sub_from; i < this.length; i += 2) {
62
+ res.push(this[i]);
63
+ }
64
+ return res;
65
+ }
66
+ get sub_empty() {
67
+ return this.sub_from === this.length;
68
+ }
69
+ sub_on(sub, pub_pos) {
70
+ const pos = this.length;
71
+ this.push(sub, pub_pos);
72
+ return pos;
73
+ }
74
+ sub_off(sub_pos) {
75
+ if (!(sub_pos < this.length)) {
76
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
77
+ }
78
+ const end = this.length - 2;
79
+ if (sub_pos !== end) {
80
+ this.peer_move(end, sub_pos);
81
+ }
82
+ this.pop();
83
+ this.pop();
84
+ if (this.length === this.sub_from)
85
+ this.reap();
86
+ }
87
+ reap() { }
88
+ track_promote() {
89
+ $mol_wire_auto?.track_next(this);
90
+ }
91
+ up() { }
92
+ down() { }
93
+ emit() {
94
+ for (let i = this.sub_from; i < this.length; i += 2) {
95
+ ;
96
+ this[i].stale();
97
+ }
98
+ }
99
+ stale() {
100
+ if (!this.affect($mol_wire_cursor.stale))
101
+ return false;
102
+ while ($mol_wire_affected.length) {
103
+ const next = $mol_wire_affected.pop();
104
+ next.affect($mol_wire_cursor.doubt);
105
+ }
106
+ return true;
107
+ }
108
+ affect(quant) {
109
+ for (let i = this.sub_from; i < this.length; i += 2) {
110
+ const sub = this[i];
111
+ $mol_wire_affected.push(sub);
112
+ }
113
+ return true;
114
+ }
115
+ peer_move(from_pos, to_pos) {
116
+ const peer = this[from_pos];
117
+ const self_pos = this[from_pos + 1];
118
+ this[to_pos] = peer;
119
+ this[to_pos + 1] = self_pos;
120
+ peer.peer_repos(self_pos, to_pos);
121
+ }
122
+ peer_repos(peer_pos, self_pos) {
123
+ this[peer_pos + 1] = self_pos;
124
+ }
125
+ }
126
+ $.$mol_wire_pub = $mol_wire_pub;
127
+ })($ || ($ = {}));
128
128
  //mol/wire/pub/pub.ts
129
129
  ;
130
- "use strict";
130
+ "use strict";
131
131
  //mol/wire/sub/sub.ts
132
132
  ;
133
- "use strict";
134
- var $;
135
- (function ($) {
136
- $.$mol_wire_auto = null;
137
- $.$mol_wire_affected = [];
138
- })($ || ($ = {}));
133
+ "use strict";
134
+ var $;
135
+ (function ($) {
136
+ $.$mol_wire_auto = null;
137
+ $.$mol_wire_affected = [];
138
+ })($ || ($ = {}));
139
139
  //mol/wire/wire.ts
140
140
 
141
141
  //# sourceMappingURL=node.test.js.map
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "mol_wire_pub",
3
- "version": "0.0.1",
3
+ "version": "1.0.0",
4
4
  "main": "node.js",
5
5
  "module": "node.esm.js",
6
6
  "browser": "web.js",
7
7
  "types": "web.d.ts",
8
8
  "dependencies": {}
9
- }
9
+ }
package/web.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/fail/fail.ts","mol/wire/cursor/cursor.ts","mol/wire/pub/pub.ts","mol/wire/sub/sub.ts","mol/wire/README.md","mol/wire/wire.ts"],"mods":{},"deps_in":{"mol/wire":{},"mol":{"mol/wire":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/wire/sub":{"mol/wire":-1},"mol/wire/pub":{"mol/wire/sub":-1},"mol/fail":{"mol/wire/pub":-4},"mol/wire/cursor":{"mol/wire/pub":-3}},"deps_out":{"mol/wire/pub":{"mol/fail":-4,"mol/wire/cursor":-3},"mol/wire":{"mol":-9007199254740991,"mol/wire/sub":-1},"mol":{"":-9007199254740991},"mol/wire/sub":{"mol/wire/pub":-1},"mol/fail":{"mol":-9007199254740991},"mol/wire/cursor":{}},"sloc":{"LICENSE":113,"md":538,"tree":31,"js":10,"ts":180,"json":86,"lock":927,"CNAME":1,"html":1},"deps":{"mol/wire/pub":{"..":-9007199254740991,"/mol/wire/pub":-1,"/mol/wire/sub":-3,"/mol/fail":-4,"/mol/wire/auto":-3,"/mol/wire/cursor/stale":-3,"/mol/wire/affected/length":-3,"/mol/wire/affected/pop":-4,"/mol/wire/cursor/doubt":-4,"/mol/wire/affected/push":-4},"mol/wire":{"..":-9007199254740991,"/mol/wire/auto":-1,"/mol/wire/sub":-1,"/mol/wire/affected":-1},"mol":{"..":-9007199254740991},"":{},"mol/wire/sub":{"..":-9007199254740991,"/mol/wire/sub":-1,"/mol/wire/pub":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/wire/cursor":{"..":-9007199254740991,"/mol/wire/cursor":-1}}}
1
+ {"files":["lang.lang.tree","LICENSE","mam.jam.js","mam.ts","package.json","README.md","sandbox.config.json","tsconfig.json","tsfmt.json","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/index.html","mol/LICENSE","mol/mol.meta.tree","mol/readme.md","mol/fail/fail.ts","mol/wire/cursor/cursor.ts","mol/wire/pub/pub.ts","mol/wire/sub/sub.ts","mol/wire/README.md","mol/wire/wire.ts"],"mods":{},"deps_in":{"mol/wire":{},"mol":{"mol/wire":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/wire/sub":{"mol/wire":-1},"mol/wire/pub":{"mol/wire/sub":-1},"mol/fail":{"mol/wire/pub":-4},"mol/wire/cursor":{"mol/wire/pub":-3}},"deps_out":{"mol/wire/pub":{"mol/fail":-4,"mol/wire/cursor":-3},"mol/wire":{"mol":-9007199254740991,"mol/wire/sub":-1},"mol":{"":-9007199254740991},"mol/wire/sub":{"mol/wire/pub":-1},"mol/fail":{"mol":-9007199254740991},"mol/wire/cursor":{}},"sloc":{"tree":31,"LICENSE":113,"js":10,"ts":180,"json":84,"md":515,"CNAME":1,"html":1},"deps":{"mol/wire/pub":{"..":-9007199254740991,"/mol/wire/pub":-1,"/mol/wire/sub":-3,"/mol/fail":-4,"/mol/wire/auto":-3,"/mol/wire/cursor/stale":-3,"/mol/wire/affected/length":-3,"/mol/wire/affected/pop":-4,"/mol/wire/cursor/doubt":-4,"/mol/wire/affected/push":-4},"mol/wire":{"..":-9007199254740991,"/mol/wire/auto":-1,"/mol/wire/sub":-1,"/mol/wire/affected":-1},"mol":{"..":-9007199254740991},"":{},"mol/wire/sub":{"..":-9007199254740991,"/mol/wire/sub":-1,"/mol/wire/pub":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/wire/cursor":{"..":-9007199254740991,"/mol/wire/cursor":-1}}}
package/web.esm.js CHANGED
@@ -18,132 +18,132 @@ $.$$ = $
18
18
  var $node = $node || {}
19
19
  void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
20
20
  ;
21
- "use strict";
22
- Error.stackTraceLimit = 50;
23
- var $;
24
- (function ($) {
25
- })($ || ($ = {}));
26
- module.exports = $;
21
+ "use strict";
22
+ Error.stackTraceLimit = 50;
23
+ var $;
24
+ (function ($) {
25
+ })($ || ($ = {}));
26
+ module.exports = $;
27
27
  //mam.ts
28
28
  ;
29
29
 
30
30
  $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
31
31
  ;
32
- "use strict";
33
- var $;
34
- (function ($) {
35
- function $mol_fail(error) {
36
- throw error;
37
- }
38
- $.$mol_fail = $mol_fail;
39
- })($ || ($ = {}));
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ function $mol_fail(error) {
36
+ throw error;
37
+ }
38
+ $.$mol_fail = $mol_fail;
39
+ })($ || ($ = {}));
40
40
  //mol/fail/fail.ts
41
41
  ;
42
- "use strict";
43
- var $;
44
- (function ($) {
45
- let $mol_wire_cursor;
46
- (function ($mol_wire_cursor) {
47
- $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
- })(-1)] = "stale";
49
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
- })(-2)] = "doubt";
51
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
- })(-3)] = "fresh";
53
- $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
- })(-4)] = "final";
55
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
- })($ || ($ = {}));
42
+ "use strict";
43
+ var $;
44
+ (function ($) {
45
+ let $mol_wire_cursor;
46
+ (function ($mol_wire_cursor) {
47
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
+ })(-1)] = "stale";
49
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
+ })(-2)] = "doubt";
51
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
+ })(-3)] = "fresh";
53
+ $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
+ })(-4)] = "final";
55
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
+ })($ || ($ = {}));
57
57
  //mol/wire/cursor/cursor.ts
58
58
  ;
59
- "use strict";
60
- var $;
61
- (function ($) {
62
- class $mol_wire_pub extends Array {
63
- static get [Symbol.species]() {
64
- return Array;
65
- }
66
- sub_from = 0;
67
- get sub_list() {
68
- const res = [];
69
- for (let i = this.sub_from; i < this.length; i += 2) {
70
- res.push(this[i]);
71
- }
72
- return res;
73
- }
74
- get sub_empty() {
75
- return this.sub_from === this.length;
76
- }
77
- sub_on(sub, pub_pos) {
78
- const pos = this.length;
79
- this.push(sub, pub_pos);
80
- return pos;
81
- }
82
- sub_off(sub_pos) {
83
- if (!(sub_pos < this.length)) {
84
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
- }
86
- const end = this.length - 2;
87
- if (sub_pos !== end) {
88
- this.peer_move(end, sub_pos);
89
- }
90
- this.pop();
91
- this.pop();
92
- if (this.length === this.sub_from)
93
- this.reap();
94
- }
95
- reap() { }
96
- track_promote() {
97
- $mol_wire_auto?.track_next(this);
98
- }
99
- up() { }
100
- down() { }
101
- emit() {
102
- for (let i = this.sub_from; i < this.length; i += 2) {
103
- ;
104
- this[i].stale();
105
- }
106
- }
107
- stale() {
108
- if (!this.affect($mol_wire_cursor.stale))
109
- return false;
110
- while ($mol_wire_affected.length) {
111
- const next = $mol_wire_affected.pop();
112
- next.affect($mol_wire_cursor.doubt);
113
- }
114
- return true;
115
- }
116
- affect(quant) {
117
- for (let i = this.sub_from; i < this.length; i += 2) {
118
- const sub = this[i];
119
- $mol_wire_affected.push(sub);
120
- }
121
- return true;
122
- }
123
- peer_move(from_pos, to_pos) {
124
- const peer = this[from_pos];
125
- const self_pos = this[from_pos + 1];
126
- this[to_pos] = peer;
127
- this[to_pos + 1] = self_pos;
128
- peer.peer_repos(self_pos, to_pos);
129
- }
130
- peer_repos(peer_pos, self_pos) {
131
- this[peer_pos + 1] = self_pos;
132
- }
133
- }
134
- $.$mol_wire_pub = $mol_wire_pub;
135
- })($ || ($ = {}));
59
+ "use strict";
60
+ var $;
61
+ (function ($) {
62
+ class $mol_wire_pub extends Array {
63
+ static get [Symbol.species]() {
64
+ return Array;
65
+ }
66
+ sub_from = 0;
67
+ get sub_list() {
68
+ const res = [];
69
+ for (let i = this.sub_from; i < this.length; i += 2) {
70
+ res.push(this[i]);
71
+ }
72
+ return res;
73
+ }
74
+ get sub_empty() {
75
+ return this.sub_from === this.length;
76
+ }
77
+ sub_on(sub, pub_pos) {
78
+ const pos = this.length;
79
+ this.push(sub, pub_pos);
80
+ return pos;
81
+ }
82
+ sub_off(sub_pos) {
83
+ if (!(sub_pos < this.length)) {
84
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
+ }
86
+ const end = this.length - 2;
87
+ if (sub_pos !== end) {
88
+ this.peer_move(end, sub_pos);
89
+ }
90
+ this.pop();
91
+ this.pop();
92
+ if (this.length === this.sub_from)
93
+ this.reap();
94
+ }
95
+ reap() { }
96
+ track_promote() {
97
+ $mol_wire_auto?.track_next(this);
98
+ }
99
+ up() { }
100
+ down() { }
101
+ emit() {
102
+ for (let i = this.sub_from; i < this.length; i += 2) {
103
+ ;
104
+ this[i].stale();
105
+ }
106
+ }
107
+ stale() {
108
+ if (!this.affect($mol_wire_cursor.stale))
109
+ return false;
110
+ while ($mol_wire_affected.length) {
111
+ const next = $mol_wire_affected.pop();
112
+ next.affect($mol_wire_cursor.doubt);
113
+ }
114
+ return true;
115
+ }
116
+ affect(quant) {
117
+ for (let i = this.sub_from; i < this.length; i += 2) {
118
+ const sub = this[i];
119
+ $mol_wire_affected.push(sub);
120
+ }
121
+ return true;
122
+ }
123
+ peer_move(from_pos, to_pos) {
124
+ const peer = this[from_pos];
125
+ const self_pos = this[from_pos + 1];
126
+ this[to_pos] = peer;
127
+ this[to_pos + 1] = self_pos;
128
+ peer.peer_repos(self_pos, to_pos);
129
+ }
130
+ peer_repos(peer_pos, self_pos) {
131
+ this[peer_pos + 1] = self_pos;
132
+ }
133
+ }
134
+ $.$mol_wire_pub = $mol_wire_pub;
135
+ })($ || ($ = {}));
136
136
  //mol/wire/pub/pub.ts
137
137
  ;
138
- "use strict";
138
+ "use strict";
139
139
  //mol/wire/sub/sub.ts
140
140
  ;
141
- "use strict";
142
- var $;
143
- (function ($) {
144
- $.$mol_wire_auto = null;
145
- $.$mol_wire_affected = [];
146
- })($ || ($ = {}));
141
+ "use strict";
142
+ var $;
143
+ (function ($) {
144
+ $.$mol_wire_auto = null;
145
+ $.$mol_wire_affected = [];
146
+ })($ || ($ = {}));
147
147
  //mol/wire/wire.ts
148
148
  ;
149
149
  export default $
package/web.js CHANGED
@@ -18,132 +18,132 @@ $.$$ = $
18
18
  var $node = $node || {}
19
19
  void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
20
20
  ;
21
- "use strict";
22
- Error.stackTraceLimit = 50;
23
- var $;
24
- (function ($) {
25
- })($ || ($ = {}));
26
- module.exports = $;
21
+ "use strict";
22
+ Error.stackTraceLimit = 50;
23
+ var $;
24
+ (function ($) {
25
+ })($ || ($ = {}));
26
+ module.exports = $;
27
27
  //mam.ts
28
28
  ;
29
29
 
30
30
  $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
31
31
  ;
32
- "use strict";
33
- var $;
34
- (function ($) {
35
- function $mol_fail(error) {
36
- throw error;
37
- }
38
- $.$mol_fail = $mol_fail;
39
- })($ || ($ = {}));
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ function $mol_fail(error) {
36
+ throw error;
37
+ }
38
+ $.$mol_fail = $mol_fail;
39
+ })($ || ($ = {}));
40
40
  //mol/fail/fail.ts
41
41
  ;
42
- "use strict";
43
- var $;
44
- (function ($) {
45
- let $mol_wire_cursor;
46
- (function ($mol_wire_cursor) {
47
- $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
- })(-1)] = "stale";
49
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
- })(-2)] = "doubt";
51
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
- })(-3)] = "fresh";
53
- $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
- })(-4)] = "final";
55
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
- })($ || ($ = {}));
42
+ "use strict";
43
+ var $;
44
+ (function ($) {
45
+ let $mol_wire_cursor;
46
+ (function ($mol_wire_cursor) {
47
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = new (class stale extends Number {
48
+ })(-1)] = "stale";
49
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = new (class doubt extends Number {
50
+ })(-2)] = "doubt";
51
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = new (class fresh extends Number {
52
+ })(-3)] = "fresh";
53
+ $mol_wire_cursor[$mol_wire_cursor["final"] = new (class solid extends Number {
54
+ })(-4)] = "final";
55
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
56
+ })($ || ($ = {}));
57
57
  //mol/wire/cursor/cursor.ts
58
58
  ;
59
- "use strict";
60
- var $;
61
- (function ($) {
62
- class $mol_wire_pub extends Array {
63
- static get [Symbol.species]() {
64
- return Array;
65
- }
66
- sub_from = 0;
67
- get sub_list() {
68
- const res = [];
69
- for (let i = this.sub_from; i < this.length; i += 2) {
70
- res.push(this[i]);
71
- }
72
- return res;
73
- }
74
- get sub_empty() {
75
- return this.sub_from === this.length;
76
- }
77
- sub_on(sub, pub_pos) {
78
- const pos = this.length;
79
- this.push(sub, pub_pos);
80
- return pos;
81
- }
82
- sub_off(sub_pos) {
83
- if (!(sub_pos < this.length)) {
84
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
- }
86
- const end = this.length - 2;
87
- if (sub_pos !== end) {
88
- this.peer_move(end, sub_pos);
89
- }
90
- this.pop();
91
- this.pop();
92
- if (this.length === this.sub_from)
93
- this.reap();
94
- }
95
- reap() { }
96
- track_promote() {
97
- $mol_wire_auto?.track_next(this);
98
- }
99
- up() { }
100
- down() { }
101
- emit() {
102
- for (let i = this.sub_from; i < this.length; i += 2) {
103
- ;
104
- this[i].stale();
105
- }
106
- }
107
- stale() {
108
- if (!this.affect($mol_wire_cursor.stale))
109
- return false;
110
- while ($mol_wire_affected.length) {
111
- const next = $mol_wire_affected.pop();
112
- next.affect($mol_wire_cursor.doubt);
113
- }
114
- return true;
115
- }
116
- affect(quant) {
117
- for (let i = this.sub_from; i < this.length; i += 2) {
118
- const sub = this[i];
119
- $mol_wire_affected.push(sub);
120
- }
121
- return true;
122
- }
123
- peer_move(from_pos, to_pos) {
124
- const peer = this[from_pos];
125
- const self_pos = this[from_pos + 1];
126
- this[to_pos] = peer;
127
- this[to_pos + 1] = self_pos;
128
- peer.peer_repos(self_pos, to_pos);
129
- }
130
- peer_repos(peer_pos, self_pos) {
131
- this[peer_pos + 1] = self_pos;
132
- }
133
- }
134
- $.$mol_wire_pub = $mol_wire_pub;
135
- })($ || ($ = {}));
59
+ "use strict";
60
+ var $;
61
+ (function ($) {
62
+ class $mol_wire_pub extends Array {
63
+ static get [Symbol.species]() {
64
+ return Array;
65
+ }
66
+ sub_from = 0;
67
+ get sub_list() {
68
+ const res = [];
69
+ for (let i = this.sub_from; i < this.length; i += 2) {
70
+ res.push(this[i]);
71
+ }
72
+ return res;
73
+ }
74
+ get sub_empty() {
75
+ return this.sub_from === this.length;
76
+ }
77
+ sub_on(sub, pub_pos) {
78
+ const pos = this.length;
79
+ this.push(sub, pub_pos);
80
+ return pos;
81
+ }
82
+ sub_off(sub_pos) {
83
+ if (!(sub_pos < this.length)) {
84
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
85
+ }
86
+ const end = this.length - 2;
87
+ if (sub_pos !== end) {
88
+ this.peer_move(end, sub_pos);
89
+ }
90
+ this.pop();
91
+ this.pop();
92
+ if (this.length === this.sub_from)
93
+ this.reap();
94
+ }
95
+ reap() { }
96
+ track_promote() {
97
+ $mol_wire_auto?.track_next(this);
98
+ }
99
+ up() { }
100
+ down() { }
101
+ emit() {
102
+ for (let i = this.sub_from; i < this.length; i += 2) {
103
+ ;
104
+ this[i].stale();
105
+ }
106
+ }
107
+ stale() {
108
+ if (!this.affect($mol_wire_cursor.stale))
109
+ return false;
110
+ while ($mol_wire_affected.length) {
111
+ const next = $mol_wire_affected.pop();
112
+ next.affect($mol_wire_cursor.doubt);
113
+ }
114
+ return true;
115
+ }
116
+ affect(quant) {
117
+ for (let i = this.sub_from; i < this.length; i += 2) {
118
+ const sub = this[i];
119
+ $mol_wire_affected.push(sub);
120
+ }
121
+ return true;
122
+ }
123
+ peer_move(from_pos, to_pos) {
124
+ const peer = this[from_pos];
125
+ const self_pos = this[from_pos + 1];
126
+ this[to_pos] = peer;
127
+ this[to_pos + 1] = self_pos;
128
+ peer.peer_repos(self_pos, to_pos);
129
+ }
130
+ peer_repos(peer_pos, self_pos) {
131
+ this[peer_pos + 1] = self_pos;
132
+ }
133
+ }
134
+ $.$mol_wire_pub = $mol_wire_pub;
135
+ })($ || ($ = {}));
136
136
  //mol/wire/pub/pub.ts
137
137
  ;
138
- "use strict";
138
+ "use strict";
139
139
  //mol/wire/sub/sub.ts
140
140
  ;
141
- "use strict";
142
- var $;
143
- (function ($) {
144
- $.$mol_wire_auto = null;
145
- $.$mol_wire_affected = [];
146
- })($ || ($ = {}));
141
+ "use strict";
142
+ var $;
143
+ (function ($) {
144
+ $.$mol_wire_auto = null;
145
+ $.$mol_wire_affected = [];
146
+ })($ || ($ = {}));
147
147
  //mol/wire/wire.ts
148
148
 
149
149
  //# sourceMappingURL=web.js.map
package/.nojekyll DELETED
File without changes