shelving
Version:
Toolkit for using data in JavaScript.
9 lines (8 loc) • 386 B
TypeScript
/**
* Subscribe to an async iterable for the lifetime of the component.
*
* @param sequence An object implementing the `AsyncIterable` interface.
* - Subscription is recreated every time this value changes.
* - Memoise this value to persist the subscription for the lifetime of the component.
*/
export declare function useSequence<T>(sequence?: AsyncIterable<T>): T | undefined;