A sweet spot between signals and observables
<p>The migration wave to signals is real, state management libraries have started to add support to support both observables and signals.</p>
<p>This is my shot together with Chau to combine observables and signals into one.</p>
<h2>Little history</h2>
<p>Angular has had observables since the beginning and the devs are used to it and have used it in almost every part of their apps.</p>
<p><strong>Angular’s reactivity</strong> was tied to <strong>rxjs</strong> (except zone.js automagic change detection)!</p>
<p>Then, SIGNALS came! They changed everything! The way we see the templates, change detection and reactivity in Angular in general!</p>
<p>Who would have thought Angular recommends calling functions in the template?!</p>
<pre>
@Component({
template: `<div>Count: {{ count() }}</div>`
})
export class MyCmp {
count = signal(0);
}</pre>
<p>(I did LOL! More here: It’s ok to use function calls in Angular templates!)</p>
<p>Signals are great! But we are used to rxjs patterns in Angular, our services are tied to rxjs subjects, observables, operators and everything else!</p>
<h2>Example scenario</h2>
<p>I have a <strong>GalleryComponent</strong> that retrieves some data from the API and it depends on an id (retrieved from route params) and global form filters.</p>
<p><a href="https://itnext.io/a-sweet-spot-between-signals-and-observables-a3c9620768f1">Read More</a></p>