import { createErrorReporter } from "./error-reporter" ; import { createVal } from "./val" ; param { function } left param { function } right return { function } export const createOr = ctx => function or ( left , right ) { return function orFn ( a , msg ? ) { return createErrorReporter ( "or" , ctx , msg , [ a , left , right ] , false , true ) ( ( ) => { const val = createVal ( ctx ) ; ctx . batchStart ( ) ; const result = val ( left ) ( a ) || val ( right ) ( a ) ; if ( ! result ) { ctx . batchCommit ( ) ; } ctx . batchPurge ( ) ; return result ; } ) ; } ; } ;