Hyperlinkv0.8.0-beta.28

Redactable

Redactable.getRedactedfunctioneffect/Redactable.ts:155
(redactable: Redactable): unknown

Returns the result of calling [symbolRedactable] on a value that is already known to be Redactable.

When to use

Use when you need to read the redacted representation from a value already verified as Redactable.

Details

This function reads the current fiber's Context from the global fiber reference and passes it to the redaction method.

Gotchas

If no fiber is active, an empty Context is passed to the redaction method.

export function getRedacted(redactable: Redactable): unknown {
  return redactable[symbolRedactable]((globalThis as any)[currentFiberTypeId]?.context ?? emptyContext)
}
Referenced by 2 symbols