floppy-disk 2.12.0 → 2.12.1

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.
@@ -84,7 +84,7 @@ export const fetcher = (options) => async (...args) => {
84
84
  });
85
85
  }
86
86
  const resText = await res.text().catch(() => undefined);
87
- throw createError('Response type is not JSON', {
87
+ throw createError('Response type is not a JSON', {
88
88
  status: res.status,
89
89
  statusText: res.statusText,
90
90
  response: resText,
package/esm/vanilla.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Maybe } from './utils';
1
2
  export type StoreData = Record<string, any>;
2
3
  export type SetStoreData<T> = Partial<T> | ((prevState: T) => Partial<T>);
3
4
  export type SelectDeps<T> = ((state: T) => any[]) | undefined | null;
@@ -8,7 +9,7 @@ export type StoreInitializer<T> = T | ((api: {
8
9
  }) => T);
9
10
  export type StoreEvent<T> = (state: T) => void;
10
11
  export type InitStoreOptions<T> = {
11
- intercept?: (nextState: T, prevState: T) => Partial<T>;
12
+ intercept?: (nextState: T, prevState: T) => Maybe<Partial<T>>;
12
13
  onFirstSubscribe?: StoreEvent<T>;
13
14
  onSubscribe?: StoreEvent<T>;
14
15
  onUnsubscribe?: StoreEvent<T>;
@@ -87,7 +87,7 @@ const fetcher = (options) => async (...args) => {
87
87
  });
88
88
  }
89
89
  const resText = await res.text().catch(() => undefined);
90
- throw (0, _1.createError)('Response type is not JSON', {
90
+ throw (0, _1.createError)('Response type is not a JSON', {
91
91
  status: res.status,
92
92
  statusText: res.statusText,
93
93
  response: resText,
package/lib/vanilla.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Maybe } from './utils';
1
2
  export type StoreData = Record<string, any>;
2
3
  export type SetStoreData<T> = Partial<T> | ((prevState: T) => Partial<T>);
3
4
  export type SelectDeps<T> = ((state: T) => any[]) | undefined | null;
@@ -8,7 +9,7 @@ export type StoreInitializer<T> = T | ((api: {
8
9
  }) => T);
9
10
  export type StoreEvent<T> = (state: T) => void;
10
11
  export type InitStoreOptions<T> = {
11
- intercept?: (nextState: T, prevState: T) => Partial<T>;
12
+ intercept?: (nextState: T, prevState: T) => Maybe<Partial<T>>;
12
13
  onFirstSubscribe?: StoreEvent<T>;
13
14
  onSubscribe?: StoreEvent<T>;
14
15
  onUnsubscribe?: StoreEvent<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "floppy-disk",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "FloppyDisk - lightweight, simple, and powerful state management library",
5
5
  "keywords": [
6
6
  "state",