Download slate/packages/slate-dom/src/utils/key.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 296 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/packages/slate-dom/src/utils/key.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/slate/packages/slate-dom/src/utils/key.ts
-
curl -L -o key.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/slate/packages/slate-dom/src/utils/key.ts
296 Bytes
| /** | |
| * An auto-incrementing identifier for keys. | |
| */ | |
| let n = 0 | |
| /** | |
| * A class that keeps track of a key string. We use a full class here because we | |
| * want to be able to use them as keys in `WeakMap` objects. | |
| */ | |
| export class Key { | |
| id: string | |
| constructor() { | |
| this.id = `${n++}` | |
| } | |
| } | |