Debouncer API Reference
Throttler API Reference
Rate Limiter API Reference
Queue API Reference
SolidAsyncThrottler
Defined in: async-throttler/createAsyncThrottler.ts:26
Extends#
- Omit<AsyncThrottler<TFn>, "store">
Type Parameters#
TFn#
TFn extends AnyAsyncFunction
TSelected#
TSelected = { }
Properties#
options#
options: AsyncThrottlerOptions<TFn> & SolidAsyncThrottlerOptions<TFn, TSelected>;Defined in: async-throttler/createAsyncThrottler.ts:30
Overrides#
Omit.optionssetOptions#
setOptions: (options) => void;Defined in: async-throttler/createAsyncThrottler.ts:32
Updates the async throttler options
Parameters#
options#
Partial<SolidAsyncThrottlerOptions<TFn, TSelected>>
Returns#
void
Overrides#
Omit.setOptionsstate#
readonly state: Accessor<Readonly<TSelected>>;Defined in: async-throttler/createAsyncThrottler.ts:58
Reactive state that will be updated when the throttler state changes
Use this instead of throttler.store.state
store#
readonly store: Store<Readonly<AsyncThrottlerState<TFn>>>;Defined in: async-throttler/createAsyncThrottler.ts:64
Deprecated#
Use throttler.state instead of throttler.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-throttler/createAsyncThrottler.ts:49
A Solid component that allows you to subscribe to the throttler state.
This is useful for tracking specific parts of the throttler 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#
<throttler.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Pending...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</throttler.Subscribe>