Skip to content

Commit

Permalink
Add doc to contructor
Browse files Browse the repository at this point in the history
  • Loading branch information
diogob committed Nov 16, 2023
1 parent 9711c33 commit 470aa21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/composable/composable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ function error(errors: ErrorWithMessage[]): Failure {
return { success: false, errors }
}

/**
* Creates a composable function.
* That function is gonna catch any errors and always return a Result.
* @param fn a function to be used as a Composable
*/
function composable<T extends Fn>(fn: T): Composable<T> {
return async (...args) => {
try {
Expand Down

0 comments on commit 470aa21

Please sign in to comment.