Skip to content

Instantly share code, notes, and snippets.

@masakih
Created November 1, 2020 01:23
Show Gist options
  • Select an option

  • Save masakih/5c92c2e54c97790c5525fbc601384f60 to your computer and use it in GitHub Desktop.

Select an option

Save masakih/5c92c2e54c97790c5525fbc601384f60 to your computer and use it in GitHub Desktop.
これ必要でしょ? #CodePiece
extension Combine.Future {
convenience init<S: Scheduler>(on scheduler: S, _ attemptToFulfill: @escaping (@escaping Future<Output, Failure>.Promise) -> Void) {
self.init { promise in
scheduler.schedule {
attemptToFulfill(promise)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment