lilyball / Tomorrowland

Lightweight Promises for Swift & Obj-C

Home Page:https://lilyball.github.io/Tomorrowland/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Promise.makeChild()

lilyball opened this issue · comments

When using Promise.propagatingCancellation(on:cancelRequested:) the client should always hand a child back to its caller. Right now the best way of producing a child looks like .then(on: .immediate, { _ in }) which is ugly and not necessarily obvious. We can add a .makeChild() method which produces a child that participates in automatic cancellation propagation, and then document this convenience on Promise.propagatingCancellation(on:cancelRequested:).