@dhmk/atom
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -31,2 +31,3 @@ export declare class _Atom<T> { | ||
export declare function runInAction<T>(fn: () => T): T; | ||
export declare const run: typeof runInAction; | ||
export declare function atTransactionEnd(fn: (isInTransaction: any) => any): void; | ||
@@ -33,0 +34,0 @@ export declare const deepReadonly: <T>(x: T) => DeepReadonly<T>; |
@@ -348,2 +348,4 @@ // global state | ||
} | ||
// convenient alias | ||
export var run = runInAction; | ||
// export function action<A extends unknown[], T>(fn: (...args: A) => T) { | ||
@@ -350,0 +352,0 @@ // return function (...args: A) { |
import { WritableAtom, Atom, NotAtom, AtomOptions } from "./atom"; | ||
export interface ObjectAtom<T> extends WritableAtom<T> { | ||
merge(arg: (prev: T) => T): void; | ||
merge(arg: (prev: T) => Partial<T>): void; | ||
merge(arg: Partial<T>): void; | ||
merge(arg: (prev: T) => Partial<T>): void; | ||
} | ||
@@ -6,0 +7,0 @@ export declare function objectAtom<T extends object>(value: T, options?: AtomOptions<T>): ObjectAtom<T>; |
@@ -31,2 +31,3 @@ export declare class _Atom<T> { | ||
export declare function runInAction<T>(fn: () => T): T; | ||
export declare const run: typeof runInAction; | ||
export declare function atTransactionEnd(fn: (isInTransaction: any) => any): void; | ||
@@ -33,0 +34,0 @@ export declare const deepReadonly: <T>(x: T) => DeepReadonly<T>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asAtom = exports.deepReadonly = exports.atTransactionEnd = exports.runInAction = exports.untracked = exports.observe = exports.atom = exports._Atom = void 0; | ||
exports.asAtom = exports.deepReadonly = exports.atTransactionEnd = exports.run = exports.runInAction = exports.untracked = exports.observe = exports.atom = exports._Atom = void 0; | ||
// global state | ||
@@ -355,2 +355,4 @@ var g_pendingAtoms = []; | ||
exports.runInAction = runInAction; | ||
// convenient alias | ||
exports.run = runInAction; | ||
// export function action<A extends unknown[], T>(fn: (...args: A) => T) { | ||
@@ -357,0 +359,0 @@ // return function (...args: A) { |
import { WritableAtom, Atom, NotAtom, AtomOptions } from "./atom"; | ||
export interface ObjectAtom<T> extends WritableAtom<T> { | ||
merge(arg: (prev: T) => T): void; | ||
merge(arg: (prev: T) => Partial<T>): void; | ||
merge(arg: Partial<T>): void; | ||
merge(arg: (prev: T) => Partial<T>): void; | ||
} | ||
@@ -6,0 +7,0 @@ export declare function objectAtom<T extends object>(value: T, options?: AtomOptions<T>): ObjectAtom<T>; |
{ | ||
"name": "@dhmk/atom", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Lightweight mobx-like observable values, computed values and side-effects", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
66082
1740