mitt
nuqs
| mitt | nuqs | |
|---|---|---|
| 18 | 13 | |
| 11,871 | 10,515 | |
| 0.4% | 1.1% | |
| 0.0 | 9.4 | |
| almost 2 years ago | 6 days ago | |
| TypeScript | TypeScript | |
| MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
mitt
-
Global Event Bus in Vue
Mitt is a tiny (~200b) functional event emitter library that works perfectly as a global event bus in Vue 3 applications. Letās see how to set it up.
-
Mitt, a tiny 200b functional eventĀ emitter.
Great Name: somehow mitt wasnāt taken.
-
Event Bus with Vue 3 and TypeScript
Mitt is a small (200 bytes) library that provides the same functionality. It doesn't have many updates, because it's simply perfect and there are not many things to improve there. It gets the job done. Don't be frightened, if in 2 years npm will say it's 2 years old. This library is just perfect with no bloatware. In the worst case, just copy-paste its code to your app.
-
Explicit Design, Part 9. Decoupling Features with Events
The implementation can vary widely depending on the requirements. For our application, we will take a small library that will do almost everything for us:
-
Best way to pass data when dealing with deeply nested components?
You can use an event bus for this, looks like they removed this functionally from vue 3 so you'll need a 3rd party package like mitt
-
Using Event Bus in Vue.js 3
then we need to install an external library implementing the event emitter interface, in this case mitt
-
What is your must have npm package on any given project?
date-fns and mitt (event emitter) are also frequent helpers, but I'm considering dayjs and nanoevents for these cases.
-
Event emitter vs global variables
Not sure I understood the post right, bit you may want to check Mitt. It's popular event emitter package that quite nicely deals with this very issue.
-
Why and how to create an Event Bus in Vuejs 3
As suggested in official docs you could use mitt library to dispatch events across components.
-
Does vue 3 have global emit?
You can use it mitt library. https://github.com/developit/mitt
nuqs
-
Pare de lutar com a URL no Next.js! š
š Confira em: https://nuqs.dev/
- Why I Migrated from MPA to SPA: App Router Refactoring in Practice
-
š Stop Fighting Next.js Search Params: Use nuqs for Type-Safe URL State
In the Next.js App Router era, managing URL search parameters should feel like managing simple React state declarative, type-safe, and without boilerplate. That's exactly what nuqs (Next.js URL Query State) delivers.
-
URL Is Your State
nuqs[0] is a great (React) library for managing state inside of the URL.
[0] https://nuqs.dev/
-
Htmx and URL State Management
Nuqs[0] does a very good job at parsing and managing search params. It's a complex issue that involves serialization and deserialization, as well as complex management of throttling URL updates. It's a wonderful library.
Forms are also complex because they involve many different data-types, client-side state, (client?) and server validation, crossing the network boundary, and so on. These are not simple issues, no matter how much the average developer would love them to be. It's time to accept the problem domain as complex.
I will say that React Server Components are a huge step towards giving power back to the URL, and also allowing developers to access the full power of both the client and the server, but the community at large has deemed the mental model too complex. Especially with forms, it enables you to build complex forms that work with or without javascript enabled, and handle crossing the boundary rather gracefully. After working with RSCs for several years now, I can't imagine going back. I've written several blog posts about them[1] and feel the community should invest more time into understanding their ideas.
I have a post in my drafts about how taking advantage of URL params properly (with or without RSCs) give our UIs object permanence. How we as web developers should be relying on it more and using it to reflect client-side state. Not always, but more often. But it's a hard post to finish as communicating and crystalizing these ideas are difficult. One day I'll get it out.
[0] https://nuqs.47ng.com
[1] https://saewitz.com/server-components-give-you-optionality
-
Mitt, a tiny 200b functional eventĀ emitter.
I found mitt imported in a file named sync.ts in nuqs package.
-
Next.js shallow search params routing
You can build abstractions around it and do whatever you want with shallow routing. For simple things it would be okay to use History API directly, but as always web development have many rough edge cases that would pop out at the least expected moment, that said, there is an excellent library out there called nuqs it makes search params first class citizen in Next.js (and other frameworks also!) and makes sure you won't encounter those rough edge cases.
-
Hook to Manage URL Search Params Like a Boss:?react-router=use&zod=validate&mess=less
nuqs - literally state manager for search params. If you want to put JSON in search params, this is your choice. It offers adapters for Next.js, React Router. And documentation is awesome.
-
Managing search parameters in Next.js with nuqs
nuqs offers a more flexible and developer-friendly approach. It simplifies query string handling by providing a declarative API, enabling users to synchronize search parameters with React.state without stress.
-
nuqs VS state-in-url - a user suggested alternative
2 projects | 3 Nov 2024
What are some alternatives?
nodejs-pubsub - Node.js client for Google Cloud Pub/Sub: Ingest event streams from anywhere, at any scale, for simple, reliable, real-time stream analytics.
Nuqs-tutorial
emitter - Event Emitter
state-in-url - Store any user state in query parameters; imagine JSON in a browser URL, while keeping types and structure of data. Dead simple, fast, and with static Typescript validation. Deep links, aka URL synchronization, made easy.
react-recurrence - A simple, customizable, and reusable component for providing the recurrence functionality.
zsx - ZSX.js - Zero JavaScript User Experience