atomaric 0.0.11 → 0.0.12

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 +3 -3
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.11",
4
+ "version": "0.0.12",
5
5
  "type": "module",
6
6
  "main": "./build/atomaric.umd.cjs",
7
7
  "module": "./build/atomaric.js",
package/types/model.d.ts CHANGED
@@ -2,7 +2,7 @@ type Sunscriber<Value> = (value: Value) => void;
2
2
 
3
3
  export type AtomStoreKey = `${string}${string}:${string}${string}`;
4
4
 
5
- export type AtomOptions<Value, Actions extends Record<string, Function> = Record<string, Function>> = {
5
+ export type AtomOptions<Value, Actions extends Record<string, Function> = {}> = {
6
6
  /** **default: true** */
7
7
  warnOnDuplicateStoreKey?: boolean;
8
8
  /** will update value if localStorage value is changed
@@ -71,7 +71,7 @@ export type DefaultActions<Value> = Value extends Set<infer V>
71
71
  ? NumberActions<Value>
72
72
  : {};
73
73
 
74
- export class Atom<Value, Actions extends Record<string, Function>> {
74
+ export class Atom<Value, Actions extends Record<string, Function> = {}> {
75
75
  constructor(defaultValue: Value, storeKeyOrOptions: AtomStoreKey | undefined | AtomOptions<Value, Actions>);
76
76
 
77
77
  readonly defaultValue: Value;
@@ -91,7 +91,7 @@ export function useAtomDo<Value>(atom: Atom<Value>): (typeof atom)['do'];
91
91
 
92
92
  export function useAtom<Value>(atom: Atom<Value>): [Value, (typeof atom)['set']];
93
93
 
94
- export type StoreKeyOrOptions<Value, Actions extends Record<string, Function>> =
94
+ export type StoreKeyOrOptions<Value, Actions extends Record<string, Function> = {}> =
95
95
  | `${string}${string}:${string}${string}`
96
96
  | AtomOptions<Value, Actions>;
97
97