ComposedGesture
Several gestures on one view combined so they race, recognize together, or wait for one another to fail.
Usage
Prefer a long press and fall back to a tap.
This type is used by orElse
// Prefer a long press and fall back to a tap.
import { Box, longPress, orElse, tap } from 'kuito';
export function PreviewCard() {
const preview = longPress({ onStart: () => console.log('Preview') });
const open = tap({
onEnd: (_event, success) => {
if (success) console.log('Open');
},
});
return (
<Box gestures={[orElse(preview, open)]} width={160} height={100} backgroundColor="#cbd5e1" />
);
}Type declaration
export interface ComposedGesture {
readonly __kuitoGesture: 'composed';
readonly mode: 'race' | 'simultaneous' | 'exclusive';
readonly gestures: readonly Composable[];
}Members 2
| Name | Type | Required | Description |
|---|---|---|---|
modereadonly | "race" | "simultaneous" | "exclusive" | Yes | — |
gesturesreadonly | readonly Composable[] | Yes | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.