Rukewe Joseph
banner
ruckydev.bsky.social
Rukewe Joseph
@ruckydev.bsky.social
Full-stack Javascript Developer | Mentor | Building Solutions with AI
🚀 Ever wondered how to write a single function that works for ANY data type?

That’s where TypeScript generics come in!

Think of them as templates for your code, making it reusable and type-safe.

Below is a simple example to fetch data from an API with a generic type:
December 20, 2024 at 11:16 AM
🗄️ Database Magic in Pure JavaScript: Meet Node.js SQLite! 🚀

Node.js now has a native SQLite module that lets you create and query databases directly in your JavaScript code.

Note: Currently experimental 🛠️
December 13, 2024 at 8:16 PM
It's easy to use, just pass in the keys and the value type. Happy typing 😁!

#TypeScript #WebDevelopment
December 4, 2024 at 6:40 AM
💡 In your `useEffect` hook, you can check if the `beforeunload` event is triggered and display a confirmation dialog if necessary.

Follow @ruckydev.bsky.social for more React tips.

#reactjs
December 4, 2024 at 6:28 AM
Check out the attached code snippet for a simple counter example. Here's what's happening:

1. We create an optimistic count that updates instantly
2. When you click "Increment", you see the count go up immediately
3. Behind the scenes, it simulates a delay (like a network request)
December 4, 2024 at 6:27 AM