Created
May 29, 2020 23:46
-
-
Save josuesasilva/3e2c012bdf94fd7026632bd9f8cc769c to your computer and use it in GitHub Desktop.
Running async operations with dependent functions
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
infix operator >>->>: LogicalConjunctionPrecedence | |
typealias AsyncJob = (@escaping () -> Void) -> Void | |
func >>->>(lhs: @escaping AsyncJob, rhs: @escaping AsyncJob) -> AsyncJob { | |
return { completion in | |
lhs { | |
rhs(completion) | |
} | |
} | |
} | |
// let job = loadBackgroundImage >>->> loadLastProgress >>->> loadAudioContent | |
// job { do something after chain execution } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment