Skip to content
Source
Sign inSign up
TanStack/pacer
Open History to see the last commit

AlpineBatcher.md

77 lines1.8 KB

1---
2id: AlpineBatcher
3title: AlpineBatcher
4---
5​
6Defined in: [batcher/createBatcher.ts:18](https://github.com/TanStack/pacer/blob/main/packages/alpine-pacer/src/batcher/createBatcher.ts#L18)
7​
8A Batcher with framework-reactive selected state. All core methods remain available.
9​
10## Extends
11​
12- `Omit`\<`Batcher`\<`TValue`\>, `"options"` \| `"setOptions"`\>
13​
14## Type Parameters
15​
16### TValue
17​
18`TValue`
19​
20### TSelected
21​
22`TSelected` = \{
23\}
24​
25## Properties
26​
27### options
28​
29```ts
30options: Omit<Required<BatcherOptions<TValue>>, "initialState" | "key" | "onItemsChange" | "onExecute"> & Partial<Pick<Required<BatcherOptions<TValue>>, "initialState" | "key" | "onItemsChange" | "onExecute">> & AlpineBatcherOptions<TValue, TSelected>;
31```
32​
33Defined in: [batcher/createBatcher.ts:22](https://github.com/TanStack/pacer/blob/main/packages/alpine-pacer/src/batcher/createBatcher.ts#L22)
34​
35***
36​
37### setOptions
38​
39```ts
40setOptions: (options) => void;
41```
42​
43Defined in: [batcher/createBatcher.ts:23](https://github.com/TanStack/pacer/blob/main/packages/alpine-pacer/src/batcher/createBatcher.ts#L23)
44​
45#### Parameters
46​
47##### options
48​
49`Partial`\<[`AlpineBatcherOptions`](AlpineBatcherOptions.md)\<`TValue`, `TSelected`\>\>
50​
51#### Returns
52​
53`void`
54​
55***
56​
57### state
58​
59```ts
60readonly state: Readonly<TSelected>;
61```
62​
63Defined in: [batcher/createBatcher.ts:29](https://github.com/TanStack/pacer/blob/main/packages/alpine-pacer/src/batcher/createBatcher.ts#L29)
64​
65Selected state. Pass a selector to opt in; the default selection is an empty object.
66​
67***
68​
69### subscribe
70​
71```ts
72subscribe: AlpinePacerSubscribe<BatcherState<TValue>>;
73```
74​
75Defined in: [batcher/createBatcher.ts:27](https://github.com/TanStack/pacer/blob/main/packages/alpine-pacer/src/batcher/createBatcher.ts#L27)
76​
77Subscribes a child owner to selected state with automatic cleanup.