Defined in: solid-pacer/src/async-debouncer/createAsyncDebouncer.ts:13
TFn extends AnyAsyncFunction
TSelected = { }
readonly state: Accessor<Readonly<TSelected>>;
readonly state: Accessor<Readonly<TSelected>>;
Defined in: solid-pacer/src/async-debouncer/createAsyncDebouncer.ts:39
Reactive state that will be updated when the debouncer state changes
Use this instead of debouncer.store.state
readonly store: Store<Readonly<AsyncDebouncerState<TFn>>>;
readonly store: Store<Readonly<AsyncDebouncerState<TFn>>>;
Defined in: solid-pacer/src/async-debouncer/createAsyncDebouncer.ts:45
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 useStore hook internally. Although, you can make the state reactive by using the useStore in your own usage.
Subscribe: <TSelected>(props) => Element;
Subscribe: <TSelected>(props) => Element;
Defined in: solid-pacer/src/async-debouncer/createAsyncDebouncer.ts:30
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.
TSelected
Element | (state) => Element
(state) => TSelected
Element
<debouncer.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Waiting...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</debouncer.Subscribe>
<debouncer.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Waiting...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</debouncer.Subscribe>