Skip to content

Commit

Permalink
feat(qio): add \QIO.bracket_\
Browse files Browse the repository at this point in the history
affects: @qio/core

post fixing with \`_\` to \`QIO.bracket\` mean that it doesn't need a function any more.
  • Loading branch information
tusharmath committed Dec 20, 2019
1 parent a95dfec commit 93428a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/lib/main/QIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,14 @@ export class QIO<A1 = unknown, E1 = never, R1 = unknown> {
)
}

public bracket_<E2, R2>(
release: QIO<void, E2, R2>
): <A3, E3, R3>(
usage: (A1: A1) => QIO<A3, E3, R3>
) => QIO<A3, E1 | E2 | E3, R1 & R2 & R3> {
return this.bracket(() => release)
}

/**
* Captures the exception thrown by the IO and
*/
Expand Down

0 comments on commit 93428a4

Please sign in to comment.