ComposedGesture
Several gestures on one view combined so they race, recognize together, or wait for one another to fail.
Verwendung
Prefer a long press and fall back to a tap.
Dieser Typ wird verwendet von 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" />
);
}Typdeklaration
export interface ComposedGesture {
readonly __kuitoGesture: 'composed';
readonly mode: 'race' | 'simultaneous' | 'exclusive';
readonly gestures: readonly Composable[];
}Mitglieder 2
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
modeschreibgeschützt | "race" | "simultaneous" | "exclusive" | Ja | — |
gesturesschreibgeschützt | readonly Composable[] | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.