identityWhenever
Skip the filter when your own test of the props' values says so.
identityWhenever(
props: string[],
when: (values: Record<string, unknown>) =,
> boolean): IdentityRule
Import identityWhenever from shaders/std.
List in props every prop the test reads: a per-pixel mapped prop among them disables the skip, and the engine needs the list to know which.
Parameters
| Name | Type | Notes |
|---|---|---|
props | string[] | |
when | (values: Record<string, unknown>) => boolean |
Example
identityWhen: identityWhenever(['amount', 'mode'], (v) => v.amount === 0 || v.mode === 'off')