Skip to content

Commit

Permalink
Add Safe to Fusion type (#365)
Browse files Browse the repository at this point in the history
Co-authored-by: znotfireman <[email protected]>
  • Loading branch information
znotfireman and znotfireman authored Jul 13, 2024
1 parent 6f78500 commit b8edd8e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Types.luau
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,17 @@ export type ScopedConstructor = (() -> Scope<{}>)

export type ContextualConstructor = <T>(defaultValue: T) -> Contextual<T>

export type Safe = <Success, Fail>(
callbacks: {
try: () -> Success,
fallback: (err: unknown) -> Fail
}
) -> Success | Fail

export type Fusion = {
version: Version,
Contextual: ContextualConstructor,
Safe: Safe,

doCleanup: (Task) -> (),
scoped: ScopedConstructor,
Expand Down

0 comments on commit b8edd8e

Please sign in to comment.