@tanstack/store
Advanced tools
Comparing version 0.0.1-beta.84 to 0.0.1-beta.85
@@ -47,2 +47,3 @@ /** | ||
batch = cb => { | ||
if (this.batching) return cb(); | ||
this.batching = true; | ||
@@ -49,0 +50,0 @@ cb(); |
@@ -43,2 +43,3 @@ /** | ||
batch = cb => { | ||
if (this.batching) return cb(); | ||
this.batching = true; | ||
@@ -45,0 +46,0 @@ cb(); |
@@ -11,3 +11,3 @@ { | ||
"name": "packages/store/src/index.ts", | ||
"uid": "5b7b-3" | ||
"uid": "7e12-3" | ||
} | ||
@@ -20,14 +20,14 @@ ] | ||
"nodeParts": { | ||
"5b7b-3": { | ||
"renderedLength": 1071, | ||
"gzipLength": 382, | ||
"7e12-3": { | ||
"renderedLength": 1109, | ||
"gzipLength": 384, | ||
"brotliLength": 0, | ||
"mainUid": "5b7b-2" | ||
"mainUid": "7e12-2" | ||
} | ||
}, | ||
"nodeMetas": { | ||
"5b7b-2": { | ||
"7e12-2": { | ||
"id": "/packages/store/src/index.ts", | ||
"moduleParts": { | ||
"index.production.js": "5b7b-3" | ||
"index.production.js": "7e12-3" | ||
}, | ||
@@ -34,0 +34,0 @@ "imported": [], |
@@ -49,2 +49,3 @@ /** | ||
batch = cb => { | ||
if (this.batching) return cb(); | ||
this.batching = true; | ||
@@ -51,0 +52,0 @@ cb(); |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Store={})}(this,(function(t){"use strict";t.Store=class{listeners=new Set;batching=!1;queue=[];constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.state!==e&&(this.options?.onUpdate?.(this.state,e),this.queue.push((()=>{this.listeners.forEach((t=>t(this.state,e)))})),this.#t())};#t=()=>{this.batching||(this.queue.forEach((t=>t())),this.queue=[])};batch=t=>{this.batching=!0,t(),this.batching=!1,this.#t()}},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Store={})}(this,(function(t){"use strict";t.Store=class{listeners=new Set;batching=!1;queue=[];constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.state!==e&&(this.options?.onUpdate?.(this.state,e),this.queue.push((()=>{this.listeners.forEach((t=>t(this.state,e)))})),this.#t())};#t=()=>{this.batching||(this.queue.forEach((t=>t())),this.queue=[])};batch=t=>{if(this.batching)return t();this.batching=!0,t(),this.batching=!1,this.#t()}},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/store", | ||
"author": "Tanner Linsley", | ||
"version": "0.0.1-beta.84", | ||
"version": "0.0.1-beta.85", | ||
"license": "MIT", | ||
@@ -31,3 +31,6 @@ "repository": "tanstack/store", | ||
], | ||
"sideEffects": false | ||
"sideEffects": false, | ||
"scripts": { | ||
"build": "rollup --config rollup.config.js" | ||
} | ||
} |
@@ -64,2 +64,3 @@ export type AnyUpdater = (...args: any[]) => any | ||
batch = (cb: () => void) => { | ||
if (this.batching) return cb() | ||
this.batching = true | ||
@@ -66,0 +67,0 @@ cb() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160258
310