ts-pattern
constate
Our great sponsors
ts-pattern | constate | |
---|---|---|
38 | 4 | |
10,882 | 3,911 | |
- | - | |
8.5 | 3.6 | |
12 days ago | about 2 years 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.
ts-pattern
-
You Don't Need React
ts-pattern has been a decent band-aid for the lack of native pattern matching, but obviously has downsides that could be avoided if it was built into the language.
https://github.com/gvergnaud/ts-pattern
- Stop nesting ternaries
-
Building React Components Using Unions in TypeScript
ts-pattern
- Pattern Matching Library for TypeScript
-
TypeScript Is Surprisingly OK for Compilers
With how powerful the type system is you can implement pattern matching via a library pretty convincingly, https://github.com/gvergnaud/ts-pattern is definitely the go-to. That being said pattern matching is hardly a requirement for being ok for implementing compilers.
-
How to achieve type safety here possible without "type hacks"?
https://github.com/gvergnaud/ts-pattern might help
- ts-pattern v5
-
[AskJS] C# in every Node.js job posting?
There's a proposal to add something like that to JavaScript but it's been stuck in limbo since 2017 although there are libraries like ts-pattern which implement it already.
- Simplifying Dynamic Classes in Vue with the class-variance-authority library | cdruc.com
- Rust Appreciation Thread
constate
-
What are your favorite small utility packages?
Another one I like is https://github.com/diegohaz/constate, also <100 lines, but it makes contexts much easier to use. FB also uses mostly contexts for state management.
-
Top 10 Awesome React Hooks Libraries
Github
-
Awesome Things Related To React Hooks 😍
constate - React Context + State
-
Top 10 React Hooks Library
Constate hook provides lifting local state to React Context Level. So you can access/update state variables anywhere in the application with few lines of code. This is useful when you use the same state in multiple components. For example, you have Themes, Colors, Fonts used in multiple components, Users are allowed to change at one place and it should be reflected in the whole application. Package written in TypeScript and very compact.
What are some alternatives?
pattern-grab - 🤛🏻 Regular Expression Data Grabber
react-useportal - 🌀 React hook for Portals
ts-adt - Generate Algebraic Data Types and pattern matchers
react-recipes - 👩🍳 A list of React Hooks utility library containing popular customized hooks
await-to-js - Async await wrapper for easy error handling without try-catch
react-notion-x - Fast and accurate React renderer for Notion. TS batteries included. ⚡️
union-types - A Typescript library for creating discriminating union types.
use-query-params - React Hook for managing state in URL query parameters with easy serialization.
ts-option
use-http - 🐶 React hook for making isomorphic http requests
typescript-coverage-report - Node command tool to generate TypeScript coverage report
state - 🚀 Tiny and powerful React hook-based state management library.