useState
Simple local state save in component.
useEffect
Side effects, subscribe, fetch
useContext
Sharing state between many components without prop drilling.
UseMemo
Memorizing expensive calculations avoids recalculating them every time you render.
useRef
Stores values that can be changed between renders, or a DOM reference.
useLayoutEffect
It fires synchronously after the DOM is updated, before painting on the screen.
useCallback
Memoizes functions to keep stable references, important when passing handlers as props to child components, especially together with React.memo.
useDeferredValue
Defers an expensive value, the component keeps responding with the old value until the new one is ready.
Promise x Observable
Promise delivers one async value once then completes.
Observable emits multiple values over time and can be subscribed, transformed, and canceled.
Pull vs push
Multiple subscribers
Cancelation
Use cases
Promise, single async task, HTTP request once, read file once
Observable, streams, user events, websockets, live data, sequences of async events