From 1f95787071793a5ed916f14126173139f5dfa05f Mon Sep 17 00:00:00 2001 From: Jack Works Date: Sun, 30 Jun 2019 17:11:04 +0800 Subject: [PATCH] Update doc --- ...atcher.watching.md => kit.watcher.iswatching.md} | 6 +++--- api-documents/kit.watcher.md | 4 ++-- api-documents/kit.watcher.schedulewatchercheck.md | 11 +++++++++++ api-documents/kit.watcher.then.md | 5 ++++- api-documents/kit.watcher.watchercallback.md | 13 ------------- 5 files changed, 20 insertions(+), 19 deletions(-) rename api-documents/{kit.watcher.watching.md => kit.watcher.iswatching.md} (59%) create mode 100644 api-documents/kit.watcher.schedulewatchercheck.md delete mode 100644 api-documents/kit.watcher.watchercallback.md diff --git a/api-documents/kit.watcher.watching.md b/api-documents/kit.watcher.iswatching.md similarity index 59% rename from api-documents/kit.watcher.watching.md rename to api-documents/kit.watcher.iswatching.md index 23d7beb..b7d3218 100644 --- a/api-documents/kit.watcher.watching.md +++ b/api-documents/kit.watcher.iswatching.md @@ -1,13 +1,13 @@ -[Home](./index.md) > [@holoflows/kit](./kit.md) > [Watcher](./kit.watcher.md) > [watching](./kit.watcher.watching.md) +[Home](./index.md) > [@holoflows/kit](./kit.md) > [Watcher](./kit.watcher.md) > [isWatching](./kit.watcher.iswatching.md) -## Watcher.watching property +## Watcher.isWatching property Is the watcher running Signature: ```typescript -protected watching: boolean; +protected isWatching: boolean; ``` diff --git a/api-documents/kit.watcher.md b/api-documents/kit.watcher.md index ead7901..db90f6d 100644 --- a/api-documents/kit.watcher.md +++ b/api-documents/kit.watcher.md @@ -28,6 +28,7 @@ export declare abstract class WatcherEventEmitter | Event emitter | | [findNodeFromListByKey](./kit.watcher.findnodefromlistbykey.md) | | (list: readonly T[], keys: readonly unknown[]) => (key: unknown) => T | null | Find node from the given list by key | | [firstVirtualNode](./kit.watcher.firstvirtualnode.md) | | T extends Element ? DomProxy<T, Before, After> : never | This virtualNode always point to the first node in the LiveSelector | +| [isWatching](./kit.watcher.iswatching.md) | | boolean | Is the watcher running | | [keyComparer](./kit.watcher.keycomparer.md) | | (a: unknown, b: unknown) => boolean | Compare between key and key, in case of you don't want the default behavior | | [lastCallbackMap](./kit.watcher.lastcallbackmap.md) | | Map<unknown, useForeachReturns<T>> | Saved callback map of last watch | | [lastKeyList](./kit.watcher.lastkeylist.md) | | readonly unknown[] | Found key list of last watch | @@ -36,14 +37,13 @@ export declare abstract class WatcherLiveSelector<T, SingleMode> | | | [mapNodeToKey](./kit.watcher.mapnodetokey.md) | | (node: T, index: number, arr: readonly T[]) => unknown | Map Node -> Key, in case of you don't want the default behavior | | [requestIdleCallback](./kit.watcher.requestidlecallback.md) | | typeof requestIdleCallback | | +| [scheduleWatcherCheck](./kit.watcher.schedulewatchercheck.md) | | (deadline?: Deadline | undefined) => void | | | [singleMode](./kit.watcher.singlemode.md) | | boolean | | | [singleModeCallback](./kit.watcher.singlemodecallback.md) | | useForeachReturns<T> | Callback for single mode | | [singleModeHasLastValue](./kit.watcher.singlemodehaslastvalue.md) | | boolean | Does it has a last iteration value in single mode? | | [singleModeLastValue](./kit.watcher.singlemodelastvalue.md) | | T | Last iteration value for single mode | | [useForeachFn](./kit.watcher.useforeachfn.md) | | useForeachFn<T, Before, After> | Saved useForeach | | [valueComparer](./kit.watcher.valuecomparer.md) | | (a: T, b: T) => boolean | Compare between value and value, in case of you don't want the default behavior | -| [watcherCallback](./kit.watcher.watchercallback.md) | | (deadline?: Deadline | undefined) => void | Should be called every watch | -| [watching](./kit.watcher.watching.md) | | boolean | Is the watcher running | ## Methods diff --git a/api-documents/kit.watcher.schedulewatchercheck.md b/api-documents/kit.watcher.schedulewatchercheck.md new file mode 100644 index 0000000..b66c57b --- /dev/null +++ b/api-documents/kit.watcher.schedulewatchercheck.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [@holoflows/kit](./kit.md) > [Watcher](./kit.watcher.md) > [scheduleWatcherCheck](./kit.watcher.schedulewatchercheck.md) + +## Watcher.scheduleWatcherCheck property + +Signature: + +```typescript +protected scheduleWatcherCheck: (deadline?: Deadline | undefined) => void; +``` diff --git a/api-documents/kit.watcher.then.md b/api-documents/kit.watcher.then.md index ca10591..f78e155 100644 --- a/api-documents/kit.watcher.then.md +++ b/api-documents/kit.watcher.then.md @@ -35,7 +35,10 @@ This is an implementation of `PromiseLike` ```ts -const value = await watcher.then(x => x.toString()) +const value = await watcher +const value2 = await watcher(undefined, undefined, { minimalResultsRequired: 5 }) +// If your watcher need parameters for startWatch +const value3 = await watcher(undefined, undefined, {}, s => s.startWatch(...)) ``` diff --git a/api-documents/kit.watcher.watchercallback.md b/api-documents/kit.watcher.watchercallback.md deleted file mode 100644 index 27009ea..0000000 --- a/api-documents/kit.watcher.watchercallback.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [@holoflows/kit](./kit.md) > [Watcher](./kit.watcher.md) > [watcherCallback](./kit.watcher.watchercallback.md) - -## Watcher.watcherCallback property - -Should be called every watch - -Signature: - -```typescript -protected watcherCallback: (deadline?: Deadline | undefined) => void; -```