Documentation / @ripl/core / parseGradientCached
Function: parseGradientCached() ​
parseGradientCached(
value):Gradient|undefined
Defined in: packages/core/src/gradient/parser.ts:277
Parses a CSS gradient string via parseGradient, memoizing the result in a bounded LRU cache shared by every rendering backend.
Parsing is pure but not cheap, and the same handful of paint strings resolve for every element on every frame, so backends should prefer this over parseGradient on any render path.
The returned object is shared between callers and must not be mutated; parse it yourself with parseGradient when a private, mutable copy is required.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
value | string | The CSS gradient string to parse. |
Returns ​
Gradient | undefined
The parsed gradient, or undefined if the string is not a recognized gradient.