aptechka 0.1.16 → 0.1.18

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.
@@ -1,5 +1,5 @@
1
1
  import { Store, StoreOptions } from './Store';
2
- export type DerivedArrayCallback<StoreType, DerivedType> = (value: StoreType) => DerivedType;
2
+ export type DerivedArrayCallback<StoreType, DerivedType> = (value: StoreType, index: number) => DerivedType;
3
3
  export declare class DerivedArray<DerivedType, StoreType extends Array<any> = Array<any>> extends Store<DerivedType[]> {
4
4
  #private;
5
5
  constructor(store: Store<StoreType>, callback: DerivedArrayCallback<StoreType[number], DerivedType>, parameters?: StoreOptions<DerivedType[]>);
@@ -1 +1 @@
1
- "use strict";var g=(e,r,t)=>{if(!r.has(e))throw TypeError("Cannot "+t)};var u=(e,r,t)=>(g(e,r,"read from private field"),t?t.call(e):r.get(e)),l=(e,r,t)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,t)},v=(e,r,t,s)=>(g(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);var S=(e,r,t,s)=>({set _(o){v(e,r,o,t)},get _(){return u(e,r,s)}});var y=(e,r,t)=>new Promise((s,o)=>{var R=i=>{try{p(t.next(i))}catch(m){o(m)}},C=i=>{try{p(t.throw(i))}catch(m){o(m)}},p=i=>i.done?s(i.value):Promise.resolve(i.value).then(R,C);p((t=t.apply(e,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../Store-D0_rDIsE.cjs"),A=require("../Derived-SjPdLJiZ.cjs"),d=require("../Composed-C2Vv1xxR.cjs");var c,a,n;class D extends d.Resource{constructor(t,s,o=100){super(t,s,{manualControl:!0,skipSubscribeNotification:!0});l(this,c,void 0);l(this,a,void 0);l(this,n,0);v(this,a,o)}get step(){return u(this,n)}startAccumulating(){v(this,c,setInterval(()=>y(this,null,function*(){++S(this,n)._,this.refetch()}),u(this,a)))}stopAccumulating(){clearInterval(u(this,c))}close(){super.close(),this.stopAccumulating()}}c=new WeakMap,a=new WeakMap,n=new WeakMap;exports.Store=h.Store;exports.activeStores=h.activeStores;exports.storeRegistry=h.storeRegistry;exports.Derived=A.Derived;exports.Composed=d.Composed;exports.DerivedArray=d.DerivedArray;exports.Resource=d.Resource;exports.CumulativeResource=D;
1
+ "use strict";var g=(e,r,t)=>{if(!r.has(e))throw TypeError("Cannot "+t)};var u=(e,r,t)=>(g(e,r,"read from private field"),t?t.call(e):r.get(e)),l=(e,r,t)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,t)},v=(e,r,t,s)=>(g(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);var S=(e,r,t,s)=>({set _(o){v(e,r,o,t)},get _(){return u(e,r,s)}});var y=(e,r,t)=>new Promise((s,o)=>{var R=i=>{try{p(t.next(i))}catch(m){o(m)}},C=i=>{try{p(t.throw(i))}catch(m){o(m)}},p=i=>i.done?s(i.value):Promise.resolve(i.value).then(R,C);p((t=t.apply(e,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../Store-D0_rDIsE.cjs"),A=require("../Derived-SjPdLJiZ.cjs"),d=require("../Composed-Mdr4ZFbI.cjs");var c,a,n;class D extends d.Resource{constructor(t,s,o=100){super(t,s,{manualControl:!0,skipSubscribeNotification:!0});l(this,c,void 0);l(this,a,void 0);l(this,n,0);v(this,a,o)}get step(){return u(this,n)}startAccumulating(){v(this,c,setInterval(()=>y(this,null,function*(){++S(this,n)._,this.refetch()}),u(this,a)))}stopAccumulating(){clearInterval(u(this,c))}close(){super.close(),this.stopAccumulating()}}c=new WeakMap,a=new WeakMap,n=new WeakMap;exports.Store=h.Store;exports.activeStores=h.activeStores;exports.storeRegistry=h.storeRegistry;exports.Derived=A.Derived;exports.Composed=d.Composed;exports.DerivedArray=d.DerivedArray;exports.Resource=d.Resource;exports.CumulativeResource=D;
@@ -33,8 +33,8 @@ var d = (t, s, e) => new Promise((r, a) => {
33
33
  });
34
34
  import { S as I, a as b, s as k } from "../Store-JOKrNVEr.js";
35
35
  import { D as j } from "../Derived-Bc88XJ8J.js";
36
- import { R as A } from "../Composed-DhtYBEmo.js";
37
- import { C as w, D as z } from "../Composed-DhtYBEmo.js";
36
+ import { R as A } from "../Composed-ClTo1f0b.js";
37
+ import { C as w, D as z } from "../Composed-ClTo1f0b.js";
38
38
  var c, u, l;
39
39
  class R extends A {
40
40
  constructor(e, r, a = 100) {
@@ -1 +1 @@
1
- "use strict";var w=(e,i,s)=>{if(!i.has(e))throw TypeError("Cannot "+s)};var n=(e,i,s)=>(w(e,i,"read from private field"),s?s.call(e):i.get(e)),d=(e,i,s)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,s)},c=(e,i,s,o)=>(w(e,i,"write to private field"),o?o.call(e,s):i.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../notifier/index.cjs"),a=require("../browser-CpzFX2xg.cjs"),h=require("../function-MthRj-GJ.cjs"),v=h.debounce(e=>{e?window.dispatchEvent(new CustomEvent("resize",{detail:{cause:e}})):window.dispatchEvent(new Event("resize"))},0);var t,r,u;class z extends b.Notifier{constructor(){super();d(this,t,!1);d(this,r,()=>{n(this,t)||(c(this,t,!0),n(this,u).call(this))});d(this,u,h.debounce(()=>{this.notify(),c(this,t,!1)},0));a.isBrowser&&(addEventListener("resize",n(this,r)),n(this,r).call(this))}subscribe(s,o){const f=super.subscribe(s,o);return n(this,t)||s(),f}}t=new WeakMap,r=new WeakMap,u=new WeakMap;const l=new z;exports.WindowResizer=z;exports.dispatchWindowResizeEvent=v;exports.windowResizer=l;
1
+ "use strict";var c=(e,i,s)=>{if(!i.has(e))throw TypeError("Cannot "+s)};var n=(e,i,s)=>(c(e,i,"read from private field"),s?s.call(e):i.get(e)),d=(e,i,s)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,s)},w=(e,i,s,o)=>(c(e,i,"write to private field"),o?o.call(e,s):i.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../notifier/index.cjs"),a=require("../browser-CpzFX2xg.cjs"),h=require("../function-MthRj-GJ.cjs"),v=h.debounce(e=>{e?window.dispatchEvent(new CustomEvent("resize",{detail:{cause:e}})):window.dispatchEvent(new Event("resize"))},0);var t,r,u;class z extends b.Notifier{constructor(){super();d(this,t,!1);d(this,r,()=>{n(this,t)||(w(this,t,!0),n(this,u).call(this))});d(this,u,h.debounce(()=>{this.notify(),w(this,t,!1)},0));a.isBrowser&&(window.addEventListener("resize",n(this,r)),n(this,r).call(this))}subscribe(s,o){const f=super.subscribe(s,o);return n(this,t)||s(),f}}t=new WeakMap,r=new WeakMap,u=new WeakMap;const l=new z;exports.WindowResizer=z;exports.dispatchWindowResizeEvent=v;exports.windowResizer=l;
@@ -1,12 +1,12 @@
1
- var f = (e, s, i) => {
2
- if (!s.has(e))
3
- throw TypeError("Cannot " + i);
1
+ var f = (e, i, s) => {
2
+ if (!i.has(e))
3
+ throw TypeError("Cannot " + s);
4
4
  };
5
- var r = (e, s, i) => (f(e, s, "read from private field"), i ? i.call(e) : s.get(e)), d = (e, s, i) => {
6
- if (s.has(e))
5
+ var r = (e, i, s) => (f(e, i, "read from private field"), s ? s.call(e) : i.get(e)), d = (e, i, s) => {
6
+ if (i.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- s instanceof WeakSet ? s.add(e) : s.set(e, i);
9
- }, w = (e, s, i, o) => (f(e, s, "write to private field"), o ? o.call(e, i) : s.set(e, i), i);
8
+ i instanceof WeakSet ? i.add(e) : i.set(e, s);
9
+ }, h = (e, i, s, o) => (f(e, i, "write to private field"), o ? o.call(e, s) : i.set(e, s), s);
10
10
  import { Notifier as p } from "../notifier/index.js";
11
11
  import { i as z } from "../browser-0zX67oeU.js";
12
12
  import { d as u } from "../function-C10DGppn.js";
@@ -19,25 +19,25 @@ const l = u((e) => {
19
19
  })
20
20
  ) : window.dispatchEvent(new Event("resize"));
21
21
  }, 0);
22
- var t, n, h;
22
+ var t, n, w;
23
23
  class a extends p {
24
24
  constructor() {
25
25
  super();
26
26
  d(this, t, !1);
27
27
  d(this, n, () => {
28
- r(this, t) || (w(this, t, !0), r(this, h).call(this));
28
+ r(this, t) || (h(this, t, !0), r(this, w).call(this));
29
29
  });
30
- d(this, h, u(() => {
31
- this.notify(), w(this, t, !1);
30
+ d(this, w, u(() => {
31
+ this.notify(), h(this, t, !1);
32
32
  }, 0));
33
- z && (addEventListener("resize", r(this, n)), r(this, n).call(this));
33
+ z && (window.addEventListener("resize", r(this, n)), r(this, n).call(this));
34
34
  }
35
- subscribe(i, o) {
36
- const c = super.subscribe(i, o);
37
- return r(this, t) || i(), c;
35
+ subscribe(s, o) {
36
+ const c = super.subscribe(s, o);
37
+ return r(this, t) || s(), c;
38
38
  }
39
39
  }
40
- t = new WeakMap(), n = new WeakMap(), h = new WeakMap();
40
+ t = new WeakMap(), n = new WeakMap(), w = new WeakMap();
41
41
  const R = new a();
42
42
  export {
43
43
  a as WindowResizer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1 +0,0 @@
1
- "use strict";var g=(r,s,e)=>{if(!s.has(r))throw TypeError("Cannot "+e)};var t=(r,s,e)=>(g(r,s,"read from private field"),e?e.call(r):s.get(r)),h=(r,s,e)=>{if(s.has(r))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(r):s.set(r,e)},f=(r,s,e,c)=>(g(r,s,"write to private field"),c?c.call(r,e):s.set(r,e),e);const x=require("./Store-D0_rDIsE.cjs"),v=require("./function-MthRj-GJ.cjs");var a;class C extends x.Store{constructor(e,c,u){super(null,u);h(this,a,void 0);f(this,a,e.subscribe(o=>{const l=[];o.current.forEach((m,p)=>{var S;o.current[p]===((S=o.previous)==null?void 0:S[p])&&this.current[p]?l.push(this.current[p]):l.push(c(m))}),this.current=l}))}close(){super.close(),t(this,a).call(this)}}a=new WeakMap;var d,n,i;class E extends x.Store{constructor(e,c,u){super(e,u);h(this,d,void 0);h(this,n,void 0);h(this,i,0);f(this,n,new x.Store(!1)),f(this,d,c),u!=null&&u.manualControl||this.refetch()}get isPending(){return t(this,n)}refetch(){t(this,n).current=!0,f(this,i,t(this,i)+1);const e=t(this,i);t(this,d).call(this).then(c=>{e===t(this,i)&&(t(this,n).current=!1,this.current=c)})}}d=new WeakMap,n=new WeakMap,i=new WeakMap;var b;class q extends x.Store{constructor(e,c,u){super(null,u);h(this,b,[]);const o=v.debounce(()=>{this.current=c()},0);e.forEach(l=>{t(this,b).push(l.subscribe(()=>{o()}))})}close(){super.close(),t(this,b).forEach(e=>e())}}b=new WeakMap;exports.Composed=q;exports.DerivedArray=C;exports.Resource=E;
@@ -1,2 +0,0 @@
1
- export declare function createContext<Context>(name: string, value: Context): void;
2
- export declare function getContext<Context>(name: string): Context;