live-cache 0.2.5 → 0.2.6
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/index.cjs +0 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +0 -25
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +0 -25
- package/dist/index.umd.js.map +1 -1
- package/dist/react/useController.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1436,31 +1436,6 @@ function useRegister(controller, store = getDefaultObjectStore()) {
|
|
|
1436
1436
|
return stored;
|
|
1437
1437
|
}
|
|
1438
1438
|
|
|
1439
|
-
/**
|
|
1440
|
-
* React hook to subscribe to a registered controller.
|
|
1441
|
-
*
|
|
1442
|
-
* - Looks up the controller by name from the `ObjectStore` (context by default)
|
|
1443
|
-
* - Subscribes to `controller.publish()`
|
|
1444
|
-
* - Exposes `data`, `loading`, `error`, and the `controller` instance
|
|
1445
|
-
*
|
|
1446
|
-
* @param name - controller name
|
|
1447
|
-
* @param where - optional `Collection.find()` filter (string `_id` or partial)
|
|
1448
|
-
* @param options - store selection, initialise behavior, abort-on-unmount, and invalidation wiring
|
|
1449
|
-
*
|
|
1450
|
-
* When `options.withInvalidation` is true, this hook calls
|
|
1451
|
-
* `controller.invalidator.registerInvalidation()` on mount and
|
|
1452
|
-
* `controller.invalidator.unregisterInvalidation()` on unmount.
|
|
1453
|
-
*
|
|
1454
|
-
* @example
|
|
1455
|
-
* ```tsx
|
|
1456
|
-
* const { data, controller } = useController<User, "users">("users", undefined, {
|
|
1457
|
-
* withInvalidation: true,
|
|
1458
|
-
* });
|
|
1459
|
-
* return (
|
|
1460
|
-
* <button onClick={() => void controller.invalidate()}>Refresh</button>
|
|
1461
|
-
* );
|
|
1462
|
-
* ```
|
|
1463
|
-
*/
|
|
1464
1439
|
function useController(controllerInstance, where, options) {
|
|
1465
1440
|
var _a, _b;
|
|
1466
1441
|
const optionalStore = options === null || options === void 0 ? void 0 : options.store;
|