atomaric 0.0.3 → 0.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/model.d.ts +5 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "atomaric",
3
3
  "description": "Manage your project state",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "type": "module",
6
6
  "main": "./build/atomaric.umd.cjs",
7
7
  "module": "./build/atomaric.js",
package/types/model.d.ts CHANGED
@@ -11,7 +11,7 @@ export type AtomOptions = {
11
11
  };
12
12
 
13
13
  export class Atom<Value> {
14
- constructor(defaultValue: Value, storeKey: AtomStoreKey | undefined | AtomOptions);
14
+ constructor(defaultValue: Value, storeKeyOrOptions: AtomStoreKey | undefined | AtomOptions);
15
15
 
16
16
  readonly defaultValue: Value;
17
17
  readonly get: () => Value;
@@ -30,6 +30,9 @@ export function useAtomInkrement(atom: Atom<number>): (typeof atom)['inkrement']
30
30
 
31
31
  export function useAtom<Value>(atom: Atom<Value>): [Value, (typeof atom)['set']];
32
32
 
33
- export function atom<Value>(value: Value, storeKey?: `${string}${string}:${string}${string}`): Atom<Value>;
33
+ export function atom<Value>(
34
+ value: Value,
35
+ storeKeyOrOptions?: `${string}${string}:${string}${string}` | AtomOptions,
36
+ ): Atom<Value>;
34
37
 
35
38
  export function registerReactHooks(hooks: { useSyncExternalStore: typeof useSyncExternalStore }): void;