Skip to content

Commit a9c9fc5

Browse files
committed
docs(async-stack): explain each member in StackItemState union
1 parent 8449f44 commit a9c9fc5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.changeset/tender-ligers-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@svelte-put/async-stack': patch
3+
---
4+
5+
add JSDocs for `StackItemState`

packages/async-stack/src/types.package.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ export type StackItemInstanceConfig<
4646
timeout: number;
4747
};
4848

49+
/**
50+
* - 'idle': stack item is active with no timeout, its component is rendered
51+
* - 'elapsing': stack item is active with a timeout that is currently counting down
52+
* - 'paused': stack item is active with a timeout that is paused
53+
* - 'timeout': stack item has reached its timeout and has been resolved
54+
* - 'resolved': stack item has been resolved (popped from the stack, its component unmounted)
55+
*/
4956
export type StackItemState = 'idle' | 'elapsing' | 'paused' | 'timeout' | 'resolved';
5057

5158
export type StackItemByVariantPushConfig<

0 commit comments

Comments
 (0)