BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/retab-ui/effect-key

Effect Key

retab-ui/effect-key
FreeUtility

Dependency-array key helpers for keyed effect lifecycles.

Install it

npx shadcn@latest add https://ui.retab.com/r/effect-key.json

Source

lib/effect-key.tsui.retab.com/r/effect-key.json
1const objectEffectKeys = new WeakMap<object, string>();
2let nextObjectEffectKey = 1;
3
4export function effectKey(value: unknown): string {
5 if (value === null) return "null";
6
7 const valueType = typeof value;
8 if (valueType === "object" || valueType === "function") {
9 return objectEffectKey(value as object);
10 }
11 if (typeof value === "string") return `string:${value.length}:${value}`;
12 if (typeof value === "symbol") {
13 return `symbol:${String((value as symbol).description)}`;
14 }
15 return `${valueType}:${String(value)}`;
16}
17
18export function joinEffectKey(parts: readonly unknown[]): string {
19 return parts.map(effectKey).join("\u0000");
20}
21
22function objectEffectKey(value: object): string {
23 const existingKey = objectEffectKeys.get(value);
24 if (existingKey) return existingKey;
25
26 const key = `object:${nextObjectEffectKey}`;
27 nextObjectEffectKey += 1;
28 objectEffectKeys.set(value, key);
29 return key;
30}

Files it writes

  • lib/effect-key.ts

Facts

Registry
retab-ui
Type
registry:lib
Access
Free
Files written
1
Licence
NOASSERTION
First indexed
2026-08-04
Last confirmed
today

Go to the source

ui.retab.com retab-dev/retab-ui on GitHub Raw registry item This item as JSON

More from retab-ui

All 130 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
CSV parsercsvretab-uiUtilitiesFreeno deps · 4 files
Document source modeldocument-sourceretab-uiUtilitiesFreeno deps
DOCX Document Resourcedocx-document-resourceretab-uiUtilitiesFreeno deps · 5 files
PDF Document Resourcepdf-document-resourceretab-uiUtilitiesFree1 dep · 6 files
Segment Interactionsegment-interactionretab-uiUtilitiesFreeno deps
Segments modelsegmentsretab-uiUtilitiesFreeno deps
Utilsutilsretab-uiUtilitiesFree2 deps
XLSX SheetJS flattenerxlsx-sheetjs-flattenerretab-uiUtilitiesFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex