https://github.com/ben-rogerson/react-signals-introduction
A small introduction to signals and how they may be used in React π€
https://github.com/ben-rogerson/react-signals-introduction
Last synced: 3 months ago
JSON representation
A small introduction to signals and how they may be used in React π€
- Host: GitHub
- URL: https://github.com/ben-rogerson/react-signals-introduction
- Owner: ben-rogerson
- Created: 2024-04-25T11:33:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-28T11:44:30.000Z (over 1 year ago)
- Last Synced: 2025-03-17T00:18:10.999Z (7 months ago)
- Language: TypeScript
- Homepage: https://react-signals-introduction.vercel.app
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React signals introduction
This repo is a quick introduction to signals using [signal-polyfill](https://www.npmjs.com/package/signal-polyfill) - a polyfill for the `Signal` API.
The [TC39 signals proposal](https://github.com/tc39/proposal-signals) is still being worked on and so things may change - but we can still see how things may end up looking.
So far itβs looking good and is fairly easy to work with - I only wish there would be method exposed to reset signal state back to the initial value.
This polyfill only exposes a `.get()` and `.set()` method but you can pass the initial value (eg: `counterState.set(INITIAL_VALUE)`) which does the same thing.[π Check the demo](https://react-signals-introduction.vercel.app/)