recompileWhen
Rebuild when your own test of the old and new value says so, for a threshold crosses cannot express.
recompileWhen(predicate: (prev: any, next: any) => boolean): RecompileRule
Import recompileWhen from shaders/std.
Parameters
| Name | Type | Notes |
|---|---|---|
predicate | (prev: any, next: any) => boolean |
Example
blur: {default: 0, recompile: recompileWhen((prev, next) => (prev > 0) !== (next > 0))}
See also
crosses— Rebuild the shader only when the prop crossesvalue, not on every change.