|
134 | 134 | * @category Checkpoints |
135 | 135 | */ |
136 | 136 | /// UndoOrRedoInformation |
| 137 | +/** |
| 138 | + * The GetId type describes a function which, when passed a parameter, will |
| 139 | + * return an Id. |
| 140 | + * |
| 141 | + * This type is used in hooks that create callbacks - like the |
| 142 | + * useSetTableCallback hook or useSetRowCallback hook - so that the Id arguments |
| 143 | + * of the object to set can also be dependent on the event or parameter |
| 144 | + * provided (as well as the object itself being set). |
| 145 | + */ |
| 146 | +/// GetId |
137 | 147 | /** |
138 | 148 | * The useCreateStore hook is used to create a Store within a React application |
139 | 149 | * with convenient memoization. |
|
2124 | 2134 | * The Store to which the callback will make the mutation (indicated by the |
2125 | 2135 | * hook's `storeOrStoreId` parameter) is always automatically used as a hook |
2126 | 2136 | * dependency for the callback. |
2127 | | - * @param tableId The Id of the Table in the Store to set. |
| 2137 | + * @param tableId The Id of the Table in the Store to set, or a GetId function |
| 2138 | + * that will return it. |
2128 | 2139 | * @param getTable A function which returns the Table object that will be used |
2129 | 2140 | * to update the Store, based on the parameter the callback will receive (and |
2130 | 2141 | * which is most likely a DOM event). |
2131 | 2142 | * @param getTableDeps An optional array of dependencies for the `getTable` |
2132 | 2143 | * function, which, if any change, result in the regeneration of the callback. |
2133 | | - * This parameter defaults to an empty array. |
| 2144 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2145 | + * dependencies of a GetId functions if used as the tableId argument. |
2134 | 2146 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2135 | 2147 | * Store, provide an Id for a named context Store, or provide an explicit |
2136 | 2148 | * reference. |
|
2201 | 2213 | * The Store to which the callback will make the mutation (indicated by the |
2202 | 2214 | * hook's `storeOrStoreId` parameter) is always automatically used as a hook |
2203 | 2215 | * dependency for the callback. |
2204 | | - * @param tableId The Id of the Table in the Store. |
2205 | | - * @param rowId The Id of the Row in the Table to set. |
| 2216 | + * @param tableId The Id of the Table in the Store, or a GetId function that |
| 2217 | + * will return it. |
| 2218 | + * @param rowId The Id of the Row in the Table to set, or a GetId function that |
| 2219 | + * will return it. |
2206 | 2220 | * @param getRow A function which returns the Row object that will be used to |
2207 | 2221 | * update the Store, based on the parameter the callback will receive (and which |
2208 | 2222 | * is most likely a DOM event). |
2209 | 2223 | * @param getRowDeps An optional array of dependencies for the `getRow` |
2210 | 2224 | * function, which, if any change, result in the regeneration of the callback. |
2211 | | - * This parameter defaults to an empty array. |
| 2225 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2226 | + * dependencies of any GetId functions if used as the tableId or rowId |
| 2227 | + * arguments. |
2212 | 2228 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2213 | 2229 | * Store, provide an Id for a named context Store, or provide an explicit |
2214 | 2230 | * reference. |
|
2287 | 2303 | * specify `reuseRowIds` to be `false`, then the Id will be a monotonically |
2288 | 2304 | * increasing string representation of an increasing integer, regardless of any |
2289 | 2305 | * you may have previously deleted. |
2290 | | - * @param tableId The Id of the Table in the Store. |
| 2306 | + * @param tableId The Id of the Table in the Store, or a GetId function |
| 2307 | + * that will return it. |
2291 | 2308 | * @param getRow A function which returns the Row object that will be used to |
2292 | 2309 | * update the Store, based on the parameter the callback will receive (and which |
2293 | 2310 | * is most likely a DOM event). |
2294 | 2311 | * @param getRowDeps An optional array of dependencies for the `getRow` |
2295 | 2312 | * function, which, if any change, result in the regeneration of the callback. |
2296 | | - * This parameter defaults to an empty array. |
| 2313 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2314 | + * dependencies of a GetId functions if used as the tableId argument. |
2297 | 2315 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2298 | 2316 | * Store, provide an Id for a named context Store, or provide an explicit |
2299 | 2317 | * reference. |
|
2367 | 2385 | * The Store to which the callback will make the mutation (indicated by the |
2368 | 2386 | * hook's `storeOrStoreId` parameter) is always automatically used as a hook |
2369 | 2387 | * dependency for the callback. |
2370 | | - * @param tableId The Id of the Table in the Store. |
2371 | | - * @param rowId The Id of the Row in the Table to set. |
| 2388 | + * @param tableId The Id of the Table in the Store, or a GetId function that |
| 2389 | + * will return it. |
| 2390 | + * @param rowId The Id of the Row in the Table to set, or a GetId function that |
| 2391 | + * will return it. |
2372 | 2392 | * @param getPartialRow A function which returns the partial Row object that |
2373 | 2393 | * will be used to update the Store, based on the parameter the callback will |
2374 | 2394 | * receive (and which is most likely a DOM event). |
2375 | 2395 | * @param getPartialRowDeps An optional array of dependencies for the `getRow` |
2376 | 2396 | * function, which, if any change, result in the regeneration of the callback. |
2377 | | - * This parameter defaults to an empty array. |
| 2397 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2398 | + * dependencies of any GetId functions if used as the tableId, rowId, or cellId |
| 2399 | + * arguments. |
2378 | 2400 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2379 | 2401 | * Store, provide an Id for a named context Store, or provide an explicit |
2380 | 2402 | * reference. |
|
2447 | 2469 | * The Store to which the callback will make the mutation (indicated by the |
2448 | 2470 | * hook's `storeOrStoreId` parameter) is always automatically used as a hook |
2449 | 2471 | * dependency for the callback. |
2450 | | - * @param tableId The Id of the Table in the Store. |
2451 | | - * @param rowId The Id of the Row in the Table. |
2452 | | - * @param cellId The Id of the Cell in the Row to set. |
| 2472 | + * @param tableId The Id of the Table in the Store, or a GetId function that |
| 2473 | + * will return it. |
| 2474 | + * @param rowId The Id of the Row in the Table, or a GetId function that will |
| 2475 | + * return it. |
| 2476 | + * @param cellId The Id of the Cell in the Row to set, or a GetId function that |
| 2477 | + * will return it. |
2453 | 2478 | * @param getCell A function which returns the Cell value that will be used to |
2454 | 2479 | * update the Store, or a MapCell function to update it, based on the parameter |
2455 | 2480 | * the callback will receive (and which is most likely a DOM event). |
2456 | 2481 | * @param getCellDeps An optional array of dependencies for the `getCell` |
2457 | 2482 | * function, which, if any change, result in the regeneration of the callback. |
2458 | | - * This parameter defaults to an empty array. |
| 2483 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2484 | + * dependencies of any GetId functions if used as the tableId, rowId, or cellId |
| 2485 | + * arguments. |
2459 | 2486 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2460 | 2487 | * Store, provide an Id for a named context Store, or provide an explicit |
2461 | 2488 | * reference. |
|
2719 | 2746 | * The Store to which the callback will make the mutation (indicated by the |
2720 | 2747 | * hook's `storeOrStoreId` parameter) is always automatically used as a hook |
2721 | 2748 | * dependency for the callback. |
2722 | | - * @param valueId The Id of the Value in the Store to set. |
| 2749 | + * @param valueId The Id of the Value in the Store to set, or a GetId function |
| 2750 | + * that will return it. |
2723 | 2751 | * @param getValue A function which returns the Value object that will be used |
2724 | 2752 | * to update the Store, based on the parameter the callback will receive (and |
2725 | 2753 | * which is most likely a DOM event). |
2726 | 2754 | * @param getValueDeps An optional array of dependencies for the `getValue` |
2727 | 2755 | * function, which, if any change, result in the regeneration of the callback. |
2728 | | - * This parameter defaults to an empty array. |
| 2756 | + * This parameter defaults to an empty array. Also use this to indicate the |
| 2757 | + * dependencies of a GetId function if used as the valueId argument. |
2729 | 2758 | * @param storeOrStoreId The Store to be updated: omit for the default context |
2730 | 2759 | * Store, provide an Id for a named context Store, or provide an explicit |
2731 | 2760 | * reference. |
|
0 commit comments