https://github.com/virtualstate/memo
memo for JSX
https://github.com/virtualstate/memo
Last synced: 3 months ago
JSON representation
memo for JSX
- Host: GitHub
- URL: https://github.com/virtualstate/memo
- Owner: virtualstate
- License: mit
- Created: 2022-08-06T01:38:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-14T09:36:05.000Z (almost 4 years ago)
- Last Synced: 2025-08-08T23:55:12.618Z (11 months ago)
- Language: TypeScript
- Homepage:
- Size: 505 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# `@virtualstate/memo`
[memo](https://github.com/tc39/proposal-function-memo) for JSX values.
[//]: # (badges)
### Support
  
### Test Coverage
   
[//]: # (badges)
## Usage
```typescript jsx
import { memo } from "@virtualstate/memo";
import { descendants } from "@virtualstate/focus";
import { Component, Body } from "./somewhere";
const tree = memo(
<>
>
);
// On the first usage, the tree will be memo'd as it is read
console.log(await descendants(tree));
// Uses the memo'd version, Component & Body aren't called again
console.log(await descendants(tree));
```