The Quick and Dirty Guide to Testing React Hooks that use RxJS
Too Long; Didn't Read
Hooks supercharge your functional components in many ways with custom hooks. Hooks can only be called inside the body of a function component. With hooks, we can abstract and decouple the logics with custom hooks. Hook use RxJs inside to listen to mouse click and delay the click with RxJs's debounceTime operator. Hook’s just replaceconst result = renderHook(() => useSubscriber(400)withconst {result) = render(())); // Test the useState` hook. // Run the test with no arguments, invalid arguments, and correct arguments.