Defined in: solid-pacer/src/async-throttler/createAsyncThrottler.ts:12
TFn extends AnyAsyncFunction
TSelected = { }
readonly state: Accessor<Readonly<TSelected>>;
readonly state: Accessor<Readonly<TSelected>>;
Defined in: solid-pacer/src/async-throttler/createAsyncThrottler.ts:38
Reactive state that will be updated when the throttler state changes
Use this instead of throttler.store.state
readonly store: Store<Readonly<AsyncThrottlerState<TFn>>>;
readonly store: Store<Readonly<AsyncThrottlerState<TFn>>>;
Defined in: solid-pacer/src/async-throttler/createAsyncThrottler.ts:44
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 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-throttler/createAsyncThrottler.ts:29
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.
TSelected
Element | (state) => Element
(state) => TSelected
Element
<throttler.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Pending...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</throttler.Subscribe>
<throttler.Subscribe selector={(state) => ({ isPending: state.isPending, isExecuting: state.isExecuting })}>
{(state) => (
<div>{state().isPending ? 'Pending...' : state().isExecuting ? 'Executing...' : 'Ready'}</div>
)}
</throttler.Subscribe>