本页还没有译文
本页 46 段还没译成한국어,下面显示的是英文原文。SolidAsyncDebouncer
还没翻译译自英文(tanstack.com)本页 46 段都还没译
Defined in: async-debouncer/createAsyncDebouncer.ts:26
Extends
Omit<AsyncDebouncer<TFn>,"store">
Type Parameters
TFn
TFn extends AnyAsyncFunction
TSelected
TSelected = {
}
Properties
options
options: AsyncDebouncerOptions<TFn> & SolidAsyncDebouncerOptions<TFn, TSelected>;Defined in: async-debouncer/createAsyncDebouncer.ts:30
Overrides
Omit.optionssetOptions
setOptions: (options) => void;Defined in: async-debouncer/createAsyncDebouncer.ts:32
Updates the async debouncer options
Parameters
options
Partial<SolidAsyncDebouncerOptions<TFn, TSelected>>
Returns
void
Overrides
Omit.setOptionsstate
readonly state: Accessor<Readonly<TSelected>>;Defined in: async-debouncer/createAsyncDebouncer.ts:58
Reactive state that will be updated when the debouncer state changes
Use this instead of debouncer.store.state
store
readonly store: Store<Readonly<AsyncDebouncerState<TFn>>>;Defined in: async-debouncer/createAsyncDebouncer.ts:64
Deprecated
Use debouncer.state instead of debouncer.store.state if you want to read reactive state.
The state on the store object is not reactive, as it has not been wrapped in a useSelector hook internally.
Although, you can make the state reactive by using the useSelector in your own usage.
Subscribe
Subscribe: <TSelected>(props) => Element;Defined in: async-debouncer/createAsyncDebouncer.ts:49
A Solid component that allows you to subscribe to the debouncer state.
This is useful for tracking specific parts of the debouncer state deep in your component tree without needing to pass a selector to the hook.
Type Parameters
TSelected
TSelected
Parameters
props
children
Element | ((state) => Element)
selector
(state) => TSelected
Returns
Element
Example
<debouncer.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Waiting...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</debouncer.Subscribe>