Override
Gesture states laid over a base: an Override stack is a list of partial targets, each on or off, and
resolve merges the ones that are on into one target, a later one's values winning. It's how hover,
press and drag lay their targets over animate.
import * as Override from "@wardic/core/Override"
const target = Override.resolve([
{ active: true, values: { scale: 1, opacity: 1 } }, // animate
{ active: hovered, values: { scale: 1.05 } }, // whileHover
{ active: pressed, values: { scale: 0.95 } }, // whileTap
])Interfaces
Override
One entry of an Override stack: a partial target whose values count only while it's active.
Properties
active
readonly active: boolean;Whether its state is on: a hover, a press.
values
readonly values: Values;The values it sets while it's on.
Functions
resolve()
function resolve(overrides): Values;An Override stack resolved to one target: for each key, the last active entry that sets it wins, and an inactive entry counts for nothing. The stack is in rising priority, the base first; its order is the binding's to choose.
Parameters
overrides
readonly Override[]