create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
28 lines (26 loc) • 535 B
text/typescript
export const handlePress = ({
onPress,
value,
onValueChange,
}: {
onPress?: () => void;
value: string;
onValueChange?: (value: string) => void;
}) => {
onValueChange ? onValueChange(value) : onPress?.();
};
export const isChecked = ({
value,
status,
contextValue,
}: {
value: string;
status?: 'checked' | 'unchecked';
contextValue?: string;
}) => {
if (contextValue !== undefined && contextValue !== null) {
return contextValue === value ? 'checked' : 'unchecked';
} else {
return status;
}
};