https://github.com/alvinsj/live-x
Playing with Web Worker+Socket & requestAnimationFrame
https://github.com/alvinsj/live-x
comlink hooks raf requestanimationframe websocket webworker
Last synced: 23 days ago
JSON representation
Playing with Web Worker+Socket & requestAnimationFrame
- Host: GitHub
- URL: https://github.com/alvinsj/live-x
- Owner: alvinsj
- Created: 2022-03-05T15:42:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2026-03-13T15:36:55.000Z (about 1 month ago)
- Last Synced: 2026-04-04T05:49:19.175Z (23 days ago)
- Topics: comlink, hooks, raf, requestanimationframe, websocket, webworker
- Language: TypeScript
- Homepage: https://live-x.vercel.app
- Size: 310 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# live-x
This repo shows:
- Use of [comlink](https://github.com/GoogleChromeLabs/comlink) and web worker to offload Socket connection handling.
- Use of [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) to manage `setState` (or batch update) within max FPS.

## Getting Started
First, install the dependencies:
```bash
yarn install
```
Define .env.localhost
```bash
# .env.local
NEXT_PUBLIC_BOOK_WS_URL=wss://www.cryptofacilities.com/ws/v1
```
Run the development server:
```bash
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## More
Please refer to docs/README.md