Comparing version 2.0.0 to 2.1.0
@@ -15,3 +15,4 @@ var __defProp = Object.defineProperty; | ||
createAtom: () => createAtom, | ||
observable: () => observable | ||
observable: () => observable, | ||
untracked: () => untracked | ||
}); | ||
@@ -146,2 +147,8 @@ | ||
} | ||
function untracked(fn) { | ||
stack.push(null); | ||
const result = fn(); | ||
stack.pop(); | ||
return result; | ||
} | ||
@@ -210,3 +217,4 @@ // src/computed.js | ||
createAtom, | ||
observable | ||
observable, | ||
untracked | ||
}); |
@@ -12,2 +12,5 @@ declare module 'quarx' { | ||
export function batch(changes: () => void): void; | ||
export function untracked<T>(fn: () => T): T; | ||
export interface Observable<T> { | ||
@@ -14,0 +17,0 @@ get: () => T; |
@@ -1,4 +0,4 @@ | ||
export { createAtom, autorun, batch } from './src/core'; | ||
export { createAtom, autorun, batch, untracked } from './src/core'; | ||
export { computed } from './src/computed'; | ||
import { box } from './src/box' | ||
export const observable = { box }; |
@@ -7,3 +7,3 @@ { | ||
"name": "quarx", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Simple dependency graph engine, MobX inspired", | ||
@@ -10,0 +10,0 @@ "main": "dist/index.js", |
@@ -71,2 +71,3 @@ # 🜉 Quarx | ||
export function batch(changes: () => void): void; | ||
export function untracked<T>(fn: () => T): T; | ||
``` | ||
@@ -73,0 +74,0 @@ #### NOTE |
@@ -148,1 +148,8 @@ const stack = []; | ||
} | ||
export function untracked(fn) { | ||
stack.push(null); | ||
const result = fn(); | ||
stack.pop(); | ||
return result; | ||
} |
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
19047
417
119