Fix concurrent-mode edge cases using useSubscription (adds useSo… (#514)
* Replace react-wonka with use-subscription
* Add initial useSource implementation based on useSubscription
* Add useBehaviourSubject to useSource.ts
* Replace useOperator with useSource + useBehaviourSubject
* Fix return value in useBehaviourSubject's effect
* Simplify state in useQuery and useSubscription
* Update useSource to use useMemo
* Take all values in useSource for toArray until synchronous values are exhausted
* Take last synchronous value instead of first
* Remove shared subscription
* Move useSource from src/utils/ to src/hooks/
* Simplify BehaviourSubject logic
* Fix tests due to useSubscription changes
* Defer fetch request by Promise.resolve() tick
This is to prevent unnecessary calls to fetch
when the teardown operation comes in immediately
* Fix completion on subscription exchange
* Address review comments
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
* Fix test and implementation for immediate fetch abort
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
authored by