Created
April 21, 2023 15:38
-
-
Save cowboyd/72940846863223b86c3d6f1527dc14f6 to your computer and use it in GitHub Desktop.
Lift a simple function into an Effection operation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function fn<TArgs extends unknown[],TReturn>(fn: (...args: TArgs) => TReturn): (...args: TArgs) => Operation<TReturn> { | |
return function* (...args: TArgs) { | |
return fn(...args); | |
} | |
} | |
// => map(fn(data => data.type)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment