cogsbox-state 0.5.445 → 0.5.446
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.
- package/dist/CogsState.d.ts +6 -2
- package/dist/CogsState.d.ts.map +1 -1
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +11 -4
package/package.json
CHANGED
package/src/CogsState.tsx
CHANGED
|
@@ -540,7 +540,7 @@ type UseCogsStateHook<
|
|
|
540
540
|
> = <StateKey extends keyof TransformedStateType<T>>(
|
|
541
541
|
stateKey: StateKey,
|
|
542
542
|
options?: Prettify<
|
|
543
|
-
OptionsType<TransformedStateType<T>[StateKey]> & { apiParams
|
|
543
|
+
OptionsType<TransformedStateType<T>[StateKey]> & { apiParams?: apiParams }
|
|
544
544
|
>
|
|
545
545
|
) => StateObject<TransformedStateType<T>[StateKey]>;
|
|
546
546
|
|
|
@@ -696,9 +696,16 @@ export function createCogsStateFromSync<
|
|
|
696
696
|
},
|
|
697
697
|
>(
|
|
698
698
|
syncSchema: TSyncSchema
|
|
699
|
-
): CogsApi<
|
|
700
|
-
|
|
701
|
-
|
|
699
|
+
): CogsApi<
|
|
700
|
+
{
|
|
701
|
+
[K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['schemas']['defaultValues'];
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
[K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['apiParams'];
|
|
705
|
+
}[keyof {
|
|
706
|
+
[K in keyof TSyncSchema['schemas']]: TSyncSchema['schemas'][K]['apiParams'];
|
|
707
|
+
}]
|
|
708
|
+
> {
|
|
702
709
|
const schemas = syncSchema.schemas;
|
|
703
710
|
const initialState: any = {};
|
|
704
711
|
|