Lifecycle
function App() {
console.log('🦄'); // <- only once per component!
return <div>...</div>
}function App() {
// create local state Subject
const state$ = new Subject();
const onClick = () => state$.next(+1);
return <div>
...
<button onClick={ onClick }>btn</button>
...
</div>
}Updates
Automatic subscription
destroy$
Last updated
Was this helpful?