import { ifElse } from "https://deno.land/x/rambda@9.4.1/immutable.d.ts";
It expects condition
, onTrue
and onFalse
functions as inputs and it returns a new function with example name of fn
.
When fn`` is called with
inputargument, it will return either
onTrue(input)or
onFalse(input)depending on
condition(input)` evaluation.
Parameters
onTrue: (a: TFiltered) => TOnTrueResult
onFalse: (a: Exclude<T, TFiltered>) => TOnFalseResult
Returns
(a: T) => TOnTrueResult | TOnFalseResult
Parameters
fn: (...args: TArgs) => boolean
onTrue: (...args: TArgs) => TOnTrueResult
onFalse: (...args: TArgs) => TOnFalseResult
Returns
(...args: TArgs) => TOnTrueResult | TOnFalseResult