Skip to content

Commit

Permalink
feat: Make public a way to break/abort flow of a pipeline
Browse files Browse the repository at this point in the history
With this, returning a "pipelineBreak" in a composed function of pipeline (or flow) will
prevent execution of succeeding functions, while the pipeline also returns pipelineBreak.
  • Loading branch information
Iku-turso committed Oct 9, 2023
1 parent e8f4f41 commit 30b58d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/fp/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,5 @@ interface GetFrom {

export const getFrom: GetFrom;
export const getSafeFrom: GetFrom;

export const pipelineBreak: Symbol;
3 changes: 2 additions & 1 deletion packages/fp/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import awaitAll from './src/awaitAll/awaitAll';
import flow from './src/flow/flow';
import flow, { pipelineBreak } from './src/flow/flow';
import isPromise from './src/isPromise/isPromise';
import isPrimitive from './src/isPrimitive/isPrimitive';
import pipeline from './src/pipeline/pipeline';
Expand All @@ -16,4 +16,5 @@ export {
mapValuesDeep,
getFrom,
getSafeFrom,
pipelineBreak,
};

0 comments on commit 30b58d9

Please sign in to comment.