Creates an async iterator for a signal.
The signal to create an async iterator for.
Optional
Options for the signal.
// assumes this is within a componentreadonly source = signal('initial');constructor() { for await (const item of signalToIterator(this.source)) { console.log(item); // 'initial', 'next'; } this.source.set('next');} Copy
// assumes this is within a componentreadonly source = signal('initial');constructor() { for await (const item of signalToIterator(this.source)) { console.log(item); // 'initial', 'next'; } this.source.set('next');}
Creates an async iterator for a signal.