You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One possible way we could handle errors would be like this: (playground link)
declareconstErrorMessage: uniquesymbol;typeError<E>={[ErrorMessage]: E}// redefine `Pipe` to stop if the accumulator has an error (avoids creating a temporary variable)typePipe<acc,xsextendsFn[]>=typeofErrorMessageextendskeyofacc
? acc
: xsextends[
infer firstextendsFn,
...infer restextendsFn[]]
? Pipe<Call<first,acc>,rest>
: acc;
We should have an error path in all pipeable functions so that they can throw when their input is incorrect. Not sure what this would look like yet.
The text was updated successfully, but these errors were encountered: