UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

16 lines (12 loc) 339 B
import { type MaybeWrapped, eagerComputed, unwrap } from "../utility"; /** * @since 0.0.1 * @category Operator */ export function useXor<T, U> ( x: MaybeWrapped<T>, y: MaybeWrapped<U> ) { return eagerComputed(function compute ( ) { const ux = unwrap(x); const uy = unwrap(y); return (!uy && ux) || (!ux && uy); }); }