Interface: RouteWatcherHandle
API / @xmachines/play-router / index / RouteWatcherHandle
Defined in: packages/play-router/src/router-bridge-base.ts:91
The narrow interface of the atom watcher. RouterBridgeBase uses it to
observe each change of actor.currentRoute.
The interface hides the whole subscription surface of the atom. It exposes the
two operations that RouterBridgeBase needs:
watch(atom)— it starts the watch of one atomunwatch()— it stops the watch and frees the resources
A framework adapter subclass touches this handle never. RouterBridgeBase makes
it and manages it internally.
Methods
unwatch()
unwatch(): void;Defined in: packages/play-router/src/router-bridge-base.ts:95
Stops the observation and frees the watcher.
Returns
void
watch()
watch(atom): void;Defined in: packages/play-router/src/router-bridge-base.ts:93
Arms the watcher on the given atom.
Parameters
| Parameter | Type |
|---|---|
atom | ReadonlyAtom<string | null> |
Returns
void