tinybase 7.2.0-beta.1 → 7.2.0-beta.2
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/@types/ui-react/index.d.ts +10 -10
- package/@types/ui-react/with-schemas/index.d.ts +12 -12
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/omni/index.js +4 -4
- package/omni/with-schemas/index.js +4 -4
- package/package.json +1 -1
- package/readme.md +3 -3
- package/releases.md +31 -3
- package/ui-react/index.js +4 -4
- package/ui-react/with-schemas/index.js +4 -4
|
@@ -10731,7 +10731,7 @@ export function useResultCellListener(
|
|
|
10731
10731
|
): void;
|
|
10732
10732
|
|
|
10733
10733
|
/**
|
|
10734
|
-
* The
|
|
10734
|
+
* The useSetParamValueCallback hook returns a parameterized callback that
|
|
10735
10735
|
* can be used to set a single parameter value for a query.
|
|
10736
10736
|
*
|
|
10737
10737
|
* This hook is useful, for example, when creating an event handler that will
|
|
@@ -10776,7 +10776,7 @@ export function useResultCellListener(
|
|
|
10776
10776
|
* parameter defaults to an empty array.
|
|
10777
10777
|
* @returns A parameterized callback for subsequent use.
|
|
10778
10778
|
* @example
|
|
10779
|
-
* This example uses the
|
|
10779
|
+
* This example uses the useSetParamValueCallback hook to create an event
|
|
10780
10780
|
* handler which updates a query parameter when an input element changes.
|
|
10781
10781
|
*
|
|
10782
10782
|
* ```jsx
|
|
@@ -10785,7 +10785,7 @@ export function useResultCellListener(
|
|
|
10785
10785
|
* import {createQueries, createStore} from 'tinybase';
|
|
10786
10786
|
* import {
|
|
10787
10787
|
* useResultTable,
|
|
10788
|
-
*
|
|
10788
|
+
* useSetParamValueCallback,
|
|
10789
10789
|
* } from 'tinybase/ui-react';
|
|
10790
10790
|
*
|
|
10791
10791
|
* const store = createStore().setTable('pets', {
|
|
@@ -10805,7 +10805,7 @@ export function useResultCellListener(
|
|
|
10805
10805
|
* );
|
|
10806
10806
|
*
|
|
10807
10807
|
* const App = () => {
|
|
10808
|
-
* const handleInput =
|
|
10808
|
+
* const handleInput = useSetParamValueCallback(
|
|
10809
10809
|
* 'dogOrCat',
|
|
10810
10810
|
* 'species',
|
|
10811
10811
|
* (e) => e.target.value,
|
|
@@ -10850,7 +10850,7 @@ export function useResultCellListener(
|
|
|
10850
10850
|
* @category Queries hooks
|
|
10851
10851
|
* @since v7.2.0
|
|
10852
10852
|
*/
|
|
10853
|
-
export function
|
|
10853
|
+
export function useSetParamValueCallback<Parameter>(
|
|
10854
10854
|
queryId: Id | GetId<Parameter>,
|
|
10855
10855
|
paramId: Id | GetId<Parameter>,
|
|
10856
10856
|
getParamValue: (parameter: Parameter, queries: Queries) => ParamValue,
|
|
@@ -10861,7 +10861,7 @@ export function useSetQueryParamValueCallback<Parameter>(
|
|
|
10861
10861
|
): ParameterizedCallback<Parameter>;
|
|
10862
10862
|
|
|
10863
10863
|
/**
|
|
10864
|
-
* The
|
|
10864
|
+
* The useSetParamValuesCallback hook returns a parameterized callback that
|
|
10865
10865
|
* can be used to set multiple parameter values for a query at once.
|
|
10866
10866
|
*
|
|
10867
10867
|
* This hook is useful, for example, when creating an event handler that will
|
|
@@ -10904,7 +10904,7 @@ export function useSetQueryParamValueCallback<Parameter>(
|
|
|
10904
10904
|
* parameter defaults to an empty array.
|
|
10905
10905
|
* @returns A parameterized callback for subsequent use.
|
|
10906
10906
|
* @example
|
|
10907
|
-
* This example uses the
|
|
10907
|
+
* This example uses the useSetParamValuesCallback hook to create an event
|
|
10908
10908
|
* handler which updates multiple query parameters when a form is submitted.
|
|
10909
10909
|
*
|
|
10910
10910
|
* ```jsx
|
|
@@ -10913,7 +10913,7 @@ export function useSetQueryParamValueCallback<Parameter>(
|
|
|
10913
10913
|
* import {createQueries, createStore} from 'tinybase';
|
|
10914
10914
|
* import {
|
|
10915
10915
|
* useResultTable,
|
|
10916
|
-
*
|
|
10916
|
+
* useSetParamValuesCallback,
|
|
10917
10917
|
* } from 'tinybase/ui-react';
|
|
10918
10918
|
*
|
|
10919
10919
|
* const store = createStore().setTable('pets', {
|
|
@@ -10935,7 +10935,7 @@ export function useSetQueryParamValueCallback<Parameter>(
|
|
|
10935
10935
|
* );
|
|
10936
10936
|
*
|
|
10937
10937
|
* const App = () => {
|
|
10938
|
-
* const handleSubmit =
|
|
10938
|
+
* const handleSubmit = useSetParamValuesCallback(
|
|
10939
10939
|
* 'speciesAndColor',
|
|
10940
10940
|
* (e) => {
|
|
10941
10941
|
* e.preventDefault();
|
|
@@ -11004,7 +11004,7 @@ export function useSetQueryParamValueCallback<Parameter>(
|
|
|
11004
11004
|
* @category Queries hooks
|
|
11005
11005
|
* @since v7.2.0
|
|
11006
11006
|
*/
|
|
11007
|
-
export function
|
|
11007
|
+
export function useSetParamValuesCallback<Parameter>(
|
|
11008
11008
|
queryId: Id | GetId<Parameter>,
|
|
11009
11009
|
getParamValues: (parameter: Parameter, queries: Queries) => ParamValues,
|
|
11010
11010
|
getParamValuesDeps?: React.DependencyList,
|
|
@@ -11777,13 +11777,13 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11777
11777
|
) => void;
|
|
11778
11778
|
|
|
11779
11779
|
/**
|
|
11780
|
-
* The
|
|
11780
|
+
* The useSetParamValueCallback hook returns a parameterized callback that
|
|
11781
11781
|
* can be used to set a single parameter value for a query.
|
|
11782
11782
|
*
|
|
11783
11783
|
* This has schema-based typing. The following is a simplified representation:
|
|
11784
11784
|
*
|
|
11785
11785
|
* ```ts override
|
|
11786
|
-
*
|
|
11786
|
+
* useSetParamValueCallback<Parameter>(
|
|
11787
11787
|
* queryId: Id | GetId<Parameter>,
|
|
11788
11788
|
* paramId: Id | GetId<Parameter>,
|
|
11789
11789
|
* getParamValue: (parameter: Parameter, queries: Queries) => ParamValue,
|
|
@@ -11836,7 +11836,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11836
11836
|
* parameter defaults to an empty array.
|
|
11837
11837
|
* @returns A parameterized callback for subsequent use.
|
|
11838
11838
|
* @example
|
|
11839
|
-
* This example uses the
|
|
11839
|
+
* This example uses the useSetParamValueCallback hook to create an event
|
|
11840
11840
|
* handler which updates a query parameter when an input element changes.
|
|
11841
11841
|
*
|
|
11842
11842
|
* ```jsx
|
|
@@ -11845,7 +11845,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11845
11845
|
* import {createQueries, createStore} from 'tinybase';
|
|
11846
11846
|
* import {
|
|
11847
11847
|
* useResultTable,
|
|
11848
|
-
*
|
|
11848
|
+
* useSetParamValueCallback,
|
|
11849
11849
|
* } from 'tinybase/ui-react';
|
|
11850
11850
|
*
|
|
11851
11851
|
* const store = createStore().setTable('pets', {
|
|
@@ -11865,7 +11865,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11865
11865
|
* );
|
|
11866
11866
|
*
|
|
11867
11867
|
* const App = () => {
|
|
11868
|
-
* const handleInput =
|
|
11868
|
+
* const handleInput = useSetParamValueCallback(
|
|
11869
11869
|
* 'dogOrCat',
|
|
11870
11870
|
* 'species',
|
|
11871
11871
|
* (e) => e.target.value,
|
|
@@ -11910,7 +11910,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11910
11910
|
* @category Queries hooks
|
|
11911
11911
|
* @since v7.2.0
|
|
11912
11912
|
*/
|
|
11913
|
-
|
|
11913
|
+
useSetParamValueCallback: <Parameter>(
|
|
11914
11914
|
queryId: Id | GetId<Schemas, Parameter, Id>,
|
|
11915
11915
|
paramId: Id | GetId<Schemas, Parameter, Id>,
|
|
11916
11916
|
getParamValue: (
|
|
@@ -11924,13 +11924,13 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11924
11924
|
) => ParameterizedCallback<Parameter>;
|
|
11925
11925
|
|
|
11926
11926
|
/**
|
|
11927
|
-
* The
|
|
11927
|
+
* The useSetParamValuesCallback hook returns a parameterized callback that
|
|
11928
11928
|
* can be used to set multiple parameter values for a query at once.
|
|
11929
11929
|
*
|
|
11930
11930
|
* This has schema-based typing. The following is a simplified representation:
|
|
11931
11931
|
*
|
|
11932
11932
|
* ```ts override
|
|
11933
|
-
*
|
|
11933
|
+
* useSetParamValuesCallback<Parameter>(
|
|
11934
11934
|
* queryId: Id | GetId<Parameter>,
|
|
11935
11935
|
* getParamValues: (parameter: Parameter, queries: Queries) => ParamValues,
|
|
11936
11936
|
* getParamValuesDeps?: React.DependencyList,
|
|
@@ -11980,7 +11980,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11980
11980
|
* parameter defaults to an empty array.
|
|
11981
11981
|
* @returns A parameterized callback for subsequent use.
|
|
11982
11982
|
* @example
|
|
11983
|
-
* This example uses the
|
|
11983
|
+
* This example uses the useSetParamValuesCallback hook to create an event
|
|
11984
11984
|
* handler which updates multiple query parameters when a form is submitted.
|
|
11985
11985
|
*
|
|
11986
11986
|
* ```jsx
|
|
@@ -11989,7 +11989,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11989
11989
|
* import {createQueries, createStore} from 'tinybase';
|
|
11990
11990
|
* import {
|
|
11991
11991
|
* useResultTable,
|
|
11992
|
-
*
|
|
11992
|
+
* useSetParamValuesCallback,
|
|
11993
11993
|
* } from 'tinybase/ui-react';
|
|
11994
11994
|
*
|
|
11995
11995
|
* const store = createStore().setTable('pets', {
|
|
@@ -12011,7 +12011,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
12011
12011
|
* );
|
|
12012
12012
|
*
|
|
12013
12013
|
* const App = () => {
|
|
12014
|
-
* const handleSubmit =
|
|
12014
|
+
* const handleSubmit = useSetParamValuesCallback(
|
|
12015
12015
|
* 'speciesAndColor',
|
|
12016
12016
|
* (e) => {
|
|
12017
12017
|
* e.preventDefault();
|
|
@@ -12080,7 +12080,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
12080
12080
|
* @category Queries hooks
|
|
12081
12081
|
* @since v7.2.0
|
|
12082
12082
|
*/
|
|
12083
|
-
|
|
12083
|
+
useSetParamValuesCallback: <Parameter>(
|
|
12084
12084
|
queryId: Id | GetId<Schemas, Parameter, Id>,
|
|
12085
12085
|
getParamValues: (
|
|
12086
12086
|
parameter: Parameter,
|