Sobes.tech

Why do we use functional state updates (passing a function to setState with the argument prev) instead of just count + 1?

291

What is the purpose of useState and why can't we just change a variable directly or use useRef?

174

How to understand when to apply optimizations? Have you ever had cases where you needed to solve performance issues?

159

Implement an event manager that accepts events in arbitrary order and sends them in the correct order by ID (starting from 1, each next one is 1 greater). Events can come from multiple channels, and order must be maintained within each channel separately. Ignore duplicate events. Use the sendEvent function for sending.

145

Practical task: improve the React counter component so that when clicking the 'Increase' button, the counter value increases by 1 and a record of the increase with the new value is added to the history; when clicking 'Decrease' — similarly; when clicking 'Reset' — the history is cleared.

145

Implement a function smartFetch, which is a wrapper over batchFetch for data requests from the backend by ID. The function should accumulate calls within a time window (timeout) and send them as a single batch request. The wait for the next window starts immediately after sending the request. IDs are unique, fetch is always successful. Properly handle the case when duplicate IDs arrive within the same window.

142

Task: Create a webpage with a multifunctional cryptocurrency table. Connect to an API and display a list of coins in the table. Minimum requirements: Project created from scratch Only Typescript Connect to API Sort by column values Search by cell values (works on a logical AND principle) Additional tasks: Custom pagination Minimal styles (pleasant and neat appearance) Global search across all cell values Ability to pin columns

136