Promises for Swift & ObjC.

Overview

PromiseKit

badge-pod badge-languages badge-pms badge-platforms badge-travis


Promises simplify asynchronous programming, freeing you up to focus on the more important things. They are easy to learn, easy to master and result in clearer, more readable code. Your co-workers will thank you.

UIApplication.shared.isNetworkActivityIndicatorVisible = true

let fetchImage = URLSession.shared.dataTask(.promise, with: url).compactMap{ UIImage(data: $0.data) }
let fetchLocation = CLLocationManager.requestLocation().lastValue

firstly {
    when(fulfilled: fetchImage, fetchLocation)
}.done { image, location in
    self.imageView.image = image
    self.label.text = "\(location)"
}.ensure {
    UIApplication.shared.isNetworkActivityIndicatorVisible = false
}.catch { error in
    self.show(UIAlertController(for: error), sender: self)
}

PromiseKit is a thoughtful and complete implementation of promises for any platform that has a swiftc. It has excellent Objective-C bridging and delightful specializations for iOS, macOS, tvOS and watchOS. It is a top-100 pod used in many of the most popular apps in the world.

codecov

PromiseKit 6

Release notes and migration guide.

Quick Start

In your Podfile:

use_frameworks!

target "Change Me!" do
  pod "PromiseKit", "~> 6.8"
end

The above gives an Xcode warning? See our Installation Guide.

PromiseKit 6, 5 and 4 support Xcode 8.3, 9.x and 10.0; Swift 3.1, 3.2, 3.3, 3.4, 4.0, 4.1, 4.2, 4.3 and 5.0 (development snapshots); iOS, macOS, tvOS, watchOS, Linux and Android; CocoaPods, Carthage and SwiftPM; (CI Matrix).

For Carthage, SwiftPM, Accio, etc., or for instructions when using older Swifts or Xcodes, see our Installation Guide. We recommend Carthage or Accio.

Professionally Supported PromiseKit is Now Available

TideLift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

Get Professional Support for PromiseKit with TideLift.

PromiseKit is Thousands of Hours of Work

Hey there, I’m Max Howell. I’m a prolific producer of open source software and probably you already use some of it (I created brew). I work full-time on open source and it’s hard; currently I earn less than minimum wage. Please help me continue my work, I appreciate it 🙏🏻

Other ways to say thanks.

Documentation

Extensions

Promises are only as useful as the asynchronous tasks they represent. Thus, we have converted (almost) all of Apple’s APIs to promises. The default CocoaPod provides Promises and the extensions for Foundation and UIKit. The other extensions are available by specifying additional subspecs in your Podfile, e.g.:

pod "PromiseKit/MapKit"          # MKDirections().calculate().then { /*…*/ }
pod "PromiseKit/CoreLocation"    # CLLocationManager.requestLocation().then { /*…*/ }

All our extensions are separate repositories at the PromiseKit organization.

I don't want the extensions!

Then don’t have them:

pod "PromiseKit/CorePromise", "~> 6.8"

Note: Carthage installations come with no extensions by default.

Choose Your Networking Library

Promise chains commonly start with a network operation. Thus, we offer extensions for URLSession:

// pod 'PromiseKit/Foundation'  # https://github.com/PromiseKit/Foundation

firstly {
    URLSession.shared.dataTask(.promise, with: try makeUrlRequest()).validate()
    // ^^ we provide `.validate()` so that eg. 404s get converted to errors
}.map {
    try JSONDecoder().decode(Foo.self, with: $0.data)
}.done { foo in
    //
}.catch { error in
    //
}

func makeUrlRequest() throws -> URLRequest {
    var rq = URLRequest(url: url)
    rq.httpMethod = "POST"
    rq.addValue("application/json", forHTTPHeaderField: "Content-Type")
    rq.addValue("application/json", forHTTPHeaderField: "Accept")
    rq.httpBody = try JSONEncoder().encode(obj)
    return rq
}

And Alamofire:

// pod 'PromiseKit/Alamofire'  # https://github.com/PromiseKit/Alamofire-

firstly {
    Alamofire
        .request("http://example.com", method: .post, parameters: params)
        .responseDecodable(Foo.self)
}.done { foo in
    //
}.catch { error in
    //
}

Nowadays, considering that:

  • We almost always POST JSON
  • We now have JSONDecoder
  • PromiseKit now has map and other functional primitives
  • PromiseKit (like Alamofire, but not raw-URLSession) also defaults to having callbacks go to the main thread

We recommend vanilla URLSession. It uses fewer black boxes and sticks closer to the metal. Alamofire was essential until the three bullet points above became true, but nowadays it isn’t really necessary.

Support

Please check our Troubleshooting Guide, and if after that you still have a question, ask at our Gitter chat channel or on our bug tracker.

Security & Vulnerability Reporting or Disclosure

https://tidelift.com/security

Comments
  • Problem with Archive with Xcode Version 7.3.1 (7D1014)

    Problem with Archive with Xcode Version 7.3.1 (7D1014)

    I am having issues with creating an archive when using PromiseKit with the newest Xcode. When trying to run an archive task I get a following error:

    1. While emitting IR SIL function @_TZFE10PromiseKitCSo20NSNotificationCenter4oncefSSCS_19NotificationPromise for 'once' at /Users/mpigulski/Development/PromiseKitArchiveTest/Pods/PromiseKit/Categories/Foundation/NSNotificationCenter+Promise.swift:22:12 Segmentation fault: 11

    I have attached a test project that allows to reproduce this: PromiseKitArchiveTest.zip

    So to reproduce use Xcode Version 7.3.1 (7D1014):

    • open the project using PromiseKitArchiveTest.xcworkspace
    • go for Product -> Archive

    Archive will fail. Help.

    opened by maciejpigulski 46
  • 'Cancel' for PromiseKit

    'Cancel' for PromiseKit

    These are the diffs for option 1 of Proposal for PromiseKit cancellation support #896. With option 1 the new cancellation code is included with CorePromise.

    The repositories involved with the pull request for option 1 are:

    Repositories | ------------- | mxcl/PromiseKit | PromiseKit/Alamofire- | PromiseKit/Bolts | PromiseKit/CoreLocation | PromiseKit/Foundation | PromiseKit/HealthKit | PromiseKit/HomeKit | PromiseKit/MapKit | PromiseKit/StoreKit | PromiseKit/SystemConfiguration | PromiseKit/UIKit |

    opened by dougzilla32 36
  • EXC_BAD_ACCESS when nesting [Promise new:...] calls

    EXC_BAD_ACCESS when nesting [Promise new:...] calls

    Result: image

    I am wrapping the internals of many asynchronous method's with

        return [PMKPromise new:^(PMKPromiseFulfiller fulfiller, PMKPromiseRejecter rejecter) {
    

    and am now finding that EXC_BAD_ACCSS issue, as mentioned on the website:

    2. EXC_BAD_ACCESS
    ARC is pretty good, but in some cases it is possible for your Promise chain to be partially deallocated. Usually when wrapping delegate systems. PromiseKit itself has macros that force additional retains and releases to avoid this.
    

    I have been "debugging" this for hours, however I can find little helpful information or correlation except that it stops if I flatten the Promise chain a little and then occurs later on.

    I am hoping that you may know what I am talking about / seen this before / have a solution. I have been up all night working on this and implemented PromiseKit everywhere and not am a little discouraged to see I have nothing to show for my nights work because of a strange error that I cannot debug.

    Please let me know if there is anything I can do to help you diagnose. Thank you!

    opened by Glavin001 32
  • 'Symbol not found'?

    'Symbol not found'?

    • PromiseKit 6.5.2
    • Xcode 10.0 (10A255)
    • Swift 4.2
    • Carthage for dependency management
    • A 3rd party framework whose Cartfile contains:
    github "mxcl/PromiseKit" ~> 6.0
    github "PromiseKit/Foundation" ~> 3.0
    

    And my project's resulting Cartfile.resolved file contains:

    github "PromiseKit/Foundation" "3.3.0"
    github "mxcl/PromiseKit" "6.5.2"
    github "realm/realm-cocoa" "v3.11.1"
    # ... (some other stuff)
    

    My app compiles fine, but immediately crashes with the error below. If I read the error right, then the 3rd party framework is expecting to find the URLRequest extension method in PromiseKit.framework rather than in PMKFoundation.framework?

    dyld: Symbol not found: _$S10Foundation10URLRequestV10PromiseKit0B11ConvertibleADWP
      Referenced from: /Users/XXXX/Library/Developer/CoreSimulator/Devices/37D783DD*/data/Containers/Bundle/Application/4073D393*/XXXXX.app/Frameworks/XXXXX.framework/XXXXX
      Expected in: /Users/XXXXX/Library/Developer/CoreSimulator/Devices/37D783DD*/data/Containers/Bundle/Application/4073D393*/XXXXX.app/Frameworks/PromiseKit.framework/PromiseKit
     in /Users/XXXXX/Library/Developer/CoreSimulator/Devices/37D783DD*/data/Containers/Bundle/Application/4073D393*/XXXX.app/Frameworks/XXXXX.framework/XXXXX
    
    

    Thanks

    opened by frizzy75 29
  • `flatMap` expectations

    `flatMap` expectations

    • PromiseKit version: 6.0.0

    I know we're in maintenance mode here, but I was wondering if you'd be open to a small discussion on the flatMap introductions in the most recent version, since Swift's long overloaded the term and made it more confusing than it needs to be (and again, recently, with compactMap), and I'm afraid the naming here may continue to bewilder folks both new to and familiar with functional programming.

    The concepts of map and flatMap in programming at large have this shape:

    // map
    [A]  => ((A) ->   B ) ->  [B]
     A?  => ((A) ->   B ) ->   B?
    F<A> => ((A) ->   B ) -> F<B>
    
    // flatMap
    [A]  => ((A) ->  [B]) ->  [B]
     A?  => ((A) ->   B?) ->   B?
    M<A> => ((A) -> M<B>) -> M<B>
    

    For PromiseKit to behave as one familiar these shapes expects, map and flatMap should look like this:

    Promise<A> => ((A) ->         B ) -> Promise<B>
    Promise<A> => ((A) -> Promise<B>) -> Promise<B>
    

    These are the two behaviors of then! The Promises/A+ spec decided to combine map and flatMap behaviors for ergonomics. Overloads in JavaScript don't have the compiler error issues you've been trying to solve, but having predictable map and flatMap would help!

    The flatMap additions to PromiseKit run counter to these intuitions. Maybe some qualifiers would help.

    https://github.com/mxcl/PromiseKit/blob/0e150f87e895d849287e8fc5053e6dfe7919577d/Sources/Thenable.swift#L57

    This looks like it's a compactMap of sorts, swallowing up optional return values.

    https://github.com/mxcl/PromiseKit/blob/0e150f87e895d849287e8fc5053e6dfe7919577d/Sources/Thenable.swift#L176

    This is performing a flatMap operation on the inner sequence, not the promise, so maybe flatMapInner would be a more appropriate name.

    Lemme know if I've been unclear or need to make any clarifications!

    opened by stephencelis 27
  • Support errors as generic type in swift promise kit.

    Support errors as generic type in swift promise kit.

    This is just an idea....

    As we know, in Swift, enums allow us to create very succinct and rich types, which is great for describing errors. Also, keeping error application logic in this domain as error propagate through the layers of an application is beneficial, only converting them into NSErrors when they need to be presented to the user.

    To this end, it would be good if PromiseKit accepted errors using a generic type. So, usage could be something like this...

    public protocol ErrorType {
        var code: Int { get }
        var domain: String { get }
        var localizedDescription: String? { get }
        var userInfo: Dictionary<NSObject, AnyObject>? { get }
    }
    
    extension NSError: ErrorType {
        public convenience init(_ error: ErrorType) {
            self.init(domain: error.domain, code: error.code, userInfo: error.userInfo)
        }
    }
    
    public class Promise<T, E: ErrorType> {
    
    public var error: E?
    
    }
    

    Then, an application can define its own Error type, which can be used to reject promises, for example:

    public enum NetworkError: ErrorType {
        case NotAuthenticated
    }
    
    public enum Error: ErrorType {
    
       case Network(NetworkError)
        // etc
    
    
        public var code: Int { 
            // etc
        }
        public var domain: String { 
            // etc
        }
    }
    

    Then, a promise can be rejected like this...

    return Promise(error: .Network(.NotAuthenticated))
    

    Using this pattern allows us to transform our custom Error type from a potentially vague error which lacks critical detail, to a specific error which can be recovered from with greater ease and clarity. At the moment, at the point I wish to reject the promise, I have to initialise an NSError, and lose the rich type detail.

    Thoughts?

    opened by danthorpe 26
  • Promise<Void> catch->Void is ambiguous

    Promise catch->Void is ambiguous

    I thought that swift incorrectly define type of a closure, but casting doesn't help. Example from README.md doesn't work for me as well. Is it bug, or i'm doing something wrong?

    screenshot

    let promise: Promise<Int> = Promise({ success, failure in
        success(10)
    })
    
    promise.then { number in
        self.remainingTimeLabel.text = "int is \(number)"
    }.catch { error in
        self.remainingTimeLabel.text = "erorr is \(error)"
    }
    
    opened by wiruzx 26
  • Canceling a promise

    Canceling a promise

    Consider an asynchronous HTTP GET method request that returns a promise:

    - (Promise*)GET:(NSString*)path;
    

    Users of this API may want to cancel the underlying asynchronous work, the HTTP request. Currently PromiseKit does not allow cancelable promises.

    I've been looking into javascript promises and cancelation. There is some discussion in the A+ spec https://github.com/promises-aplus/cancellation-spec/issues

    Any thoughts on cancelation?

    opened by dbachrach 26
  • Why is AnyPromise not available with SPM?

    Why is AnyPromise not available with SPM?

    • Please specify the PromiseKit major version you are using 6

    • Please specify how you installed PromiseKit, ie. Carthage, CocoaPods, SwiftPM or other. If other provide DETAILED information about how you are integrating PromiseKit. CocoaPods and indirectly with SPM (see text)

    AnyPromise is not available when using Swift PackageManager. But why? I read in another issue that this is documented but I can't find anything regarding this fact.

    My Problem:

    I'm using PromiseKit in a mixed Swift/ObjC project. I'm including PromiseKit using CocoaPods but trying to successively switch to SPM. Since I need AnyPromise, I wasn't able to move PromiseKit from CocoaPods to SPM so far.

    But now I ran into another Problem: I'm using a SwiftPackage, which itself has a dependency to PromiseKit. Now my main project is complaining that AnyPromise isn't available, because the SPM (internal) dependency to PromiseKit is "overriding" the CocoaPods dependency. As far as I know, there is no way, to create something like a "private" dependency within a Swift Package. All dependencies are automatically "re-exported" and visible to the main project.

    I was searching through the Swift Forums already but there currently seems to be no way to avoid re-exporting SPM package dependencies. Maybe if I understand why AnyPromise isn't available when using SPM I might be able to find a workaround.

    opened by DG0BAB 25
  • [Proposal] Provide for separate handling of specific errors in promise chains.

    [Proposal] Provide for separate handling of specific errors in promise chains.

    Intro

    Currently all errors in a promise chain propagate down to a single catch handler at the end. Therein, the identity of the error must often be reasoned out with comparative statements and then handled according to its identity. This can lead to otherwise clean chains becoming bottom-heavy with logic in the catch.

    Swift's do-catch provides for error pattern matching in its catch handlers, raising the error identification logic up one level. This PR provides an implementation to introduce this pattern into PromiseKit, allowing for separate catch handlers for specific errors.

    refs #639

    Usage

    The new catchOnly method included in this PR works the same as the current catch method, except that it takes a required Error parameter, and only executes its handler if the promise chain rejects with that error.

    firstly {
        API.findUser(named: "Taylor")
    }.done { user in
        //…
    }.catchOnly(API.Error.noResults) {
        //Let the user know there's no results for their query
    }.catch { error in
        //Handle other errors like timeouts
    }
    

    In the above, the catchOnly handler would only execute if the API request rejected with a noResults error. The final catch handler would then no longer execute since the error was already handled. Likewise, if some other error occurred, the catchOnly handler would be skipped and only the final catch handler would be executed.

    An arbitrary number of catchOnly calls may be chained, but the chain must still be terminated with a final catch. An overload for catchOnly which takes a type instead of an object is also provided for matching on a family of errors.

    Implementation

    The new functions work similarly to the current catch function, only instead of returning a PMKFinalizer they return a void promise which is fulfilled if the error is handled (or if the promise was fulfilled), and rejected with the unhandled error otherwise to allow it to propagate to successive catch handlers.

    Since no changes were made to existing API or implementations, a major version rev should not be necessary. I have included some trivial tests in the PR as evidence that the new functions behave as intended, but I am happy to flesh these out or strip them entirely upon request.

    I've not included any implementation for the Objective-C interface (not sure if it's necessary or even desired). But I am happy to do so if requested.

    Ideally, I would have preferred a simple catch(Error.someError) signature both for succinctness and keeping in line with Swift's do-catch, but it surfaced the usual compiler confusion that PMK's overloads have dealt with in the past. I settled on catchOnly to get around this, but I actually rather like it now, and its visual distinctness in code from the base catch is probably for the best. Still, open to name changes, of course.

    Limitations

    Since the new catchOnly functions return a promise, it is possible to chain off of them with functions other than catchOnly and catch. This isn't desirable, but is also unlikely to to be utilized, I believe, since the underlying value from the promise would have been consumed by catchOnly. A chained then or done for instance would have no context. I had originally intended to return a PMKFinalizer to avoid this, but that solution quickly proved to have too many issues.

    Error objects with associated values, while technically supported, make little sense in the usage of catchOnly since concrete associated values would need to be supplied in order to pattern match. However, the type-accepting overload of catchOnly can still prove useful in these cases.

    Errors passed in must conform to Equatable, but this is given for free in most situations in Swift 4 now.

    Alternatives

    recover may already be used in a similar manner to catchOnly (as described in #639). And this doesn't appear to be a hotly requested or needed feature by any means. So, leaving it out of PromiseKit probably isn't going to cause any friction.

    opened by nathanhosselton 25
  • Apple Watch Extension failing - No such module

    Apple Watch Extension failing - No such module "PromiseKit"

    I am currently working on an Apple Watch app extension that uses PromiseKit. I installed the project by following the instructions: Dragging the project into my project folder in xcode, then adding the embedded binary to both the iOS and Watchkit Extension project.

    After a long time fumbling around, trying to figure out why it says, No such module "PromiseKit", I was finally able to deploy it to a simulator after running a build for PromiseKit on that same device before deploying the WatchKit Extension.

    Unfortunately, there appears to be no solution to solving this problem when running on the actual Apple Watch device, as it is not an option in the build configuration to build it on the device first.

    Is this supposed to be expected behavior? That it must be built on the device first? Is there something that might be going wrong?

    I am using XCode 10.1 beta 3 BTW

    Thank you very much,

    opened by Guardiannw 25
  • Bump decode-uri-component from 0.2.0 to 0.2.2 in /Tests/JS-A+

    Bump decode-uri-component from 0.2.0 to 0.2.2 in /Tests/JS-A+

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump qs from 6.4.0 to 6.4.1 in /Tests/JS-A+

    Bump qs from 6.4.0 to 6.4.1 in /Tests/JS-A+

    Bumps qs from 6.4.0 to 6.4.1.

    Changelog

    Sourced from qs's changelog.

    6.4.1

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] use safer-buffer instead of Buffer constructor
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Fix] utils.merge`: avoid a crash with a null target and a truthy non-array source
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] Clean up license text so it’s properly detected as BSD-3-Clause
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 486aa46 v6.4.1
    • 727ef5d [Fix] parse: ignore __proto__ keys (#428)
    • cd1874e [Robustness] stringify: avoid relying on a global undefined (#427)
    • 45e987c [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 90a3bce [meta] fix README.md (#399)
    • 9566d25 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • 74227ef Clean up license text so it’s properly detected as BSD-3-Clause
    • 35dfb22 [actions] backport actions from main
    • 7d4670f [Dev Deps] backport from main
    • 0485440 [Fix] use safer-buffer instead of Buffer constructor
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump loader-utils from 1.1.0 to 1.4.2 in /Tests/JS-A+

    Bump loader-utils from 1.1.0 to 1.4.2 in /Tests/JS-A+

    Bumps loader-utils from 1.1.0 to 1.4.2.

    Release notes

    Sourced from loader-utils's releases.

    v1.4.2

    1.4.2 (2022-11-11)

    Bug Fixes

    v1.4.1

    1.4.1 (2022-11-07)

    Bug Fixes

    v1.4.0

    1.4.0 (2020-02-19)

    Features

    • the resourceQuery is passed to the interpolateName method (#163) (cd0e428)

    v1.3.0

    1.3.0 (2020-02-19)

    Features

    • support the [query] template for the interpolatedName method (#162) (469eeba)

    v1.2.3

    1.2.3 (2018-12-27)

    Bug Fixes

    • interpolateName: don't interpolated hashType without hash or contenthash (#140) (3528fd9)

    v1.2.2

    1.2.2 (2018-12-27)

    Bug Fixes

    ... (truncated)

    Changelog

    Sourced from loader-utils's changelog.

    1.4.2 (2022-11-11)

    Bug Fixes

    1.4.1 (2022-11-07)

    Bug Fixes

    1.4.0 (2020-02-19)

    Features

    • the resourceQuery is passed to the interpolateName method (#163) (cd0e428)

    1.3.0 (2020-02-19)

    Features

    • support the [query] template for the interpolatedName method (#162) (469eeba)

    1.2.3 (2018-12-27)

    Bug Fixes

    • interpolateName: don't interpolated hashType without hash or contenthash (#140) (3528fd9)

    1.2.2 (2018-12-27)

    Bug Fixes

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by evilebottnawi, a new releaser for loader-utils since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Issues when submitting to App Store building against iOS 16

    Issues when submitting to App Store building against iOS 16

    I've just built and uploaded a version of an app to the AppStore and received a warning indicating that PromiseKit is using non-public selectors from the upload process - I've submitted the build for TestFlight review (haven't submitted for a full review yet) but haven't gotten an approval/rejection at the time of writing

    I assume it's actually just a naming collision rather than using non-public APIs but wanted to raise the issue ASAP to try and get a jump on a potential review rejection

    Screen Shot 2022-10-06 at 10 43 00 am

    XCode: 14.0.1 PromiseKit: 6.18.1 Installation: CocoaPods

    opened by mpretty-cyro 6
  • Crash on iOS11/12

    Crash on iOS11/12

    it will crash on iOS11/12 because of this code:

    version: 6.18.0 #if swift(>=5.5) @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) public extension Guarantee { func async() async -> T { await withCheckedContinuation { continuation in done { value in continuation.resume(returning: value) } } } }

    @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) public extension Promise { func async() async throws -> T { try await withCheckedThrowingContinuation { continuation in done { value in continuation.resume(returning: value) }.catch { error in continuation.resume(throwing: error) } } } } #endif

    opened by zzzzzyijie 3
  • Bump codecov from 3.0.0 to 3.8.3 in /Tests/JS-A+

    Bump codecov from 3.0.0 to 3.8.3 in /Tests/JS-A+

    Bumps codecov from 3.0.0 to 3.8.3.

    Release notes

    Sourced from codecov's releases.

    v3.8.3

    Fixes

    • #329 fix: Test if response has two lines

    Dependencies

    • #306 Bump eslint-config-prettier from 7.2.0 to 8.3.0
    • #305 Bump eslint from 7.21.0 to 7.25.0
    • #302 Bump mock-fs from 4.13.0 to 4.14.0
    • #308 Bump lodash from 4.17.19 to 4.17.21
    • #309 Bump ignore-walk from 3.0.3 to 3.0.4
    • #310 Bump hosted-git-info from 2.8.8 to 2.8.9
    • #325 Bump prettier from 2.2.1 to 2.3.2
    • #326 Bump actions/setup-node from 2.1.5 to 2.2.0
    • #328 Bump lint-staged from 10.5.4 to 11.0.1
    • #330 Bump eslint from 7.25.0 to 7.31.0
    • #331 Bump ws from 7.3.1 to 7.5.3
    • #332 Bump urlgrey from 0.4.4 to 1.0.0
    • #334 Bump husky from 6.0.0 to 7.0.1
    • #333 Bump teeny-request from 7.0.1 to 7.1.1

    v3.8.2

    3.8.2

    Fixes

    • #304 Add coverage-final.json as a possible coverage file during file lookup

    v3.8.1

    Fixes

    • #246 Revert "Bump teeny-request from 6.0.1 to 7.0.0"

    v3.8.0

    Features

    • #160 Add Github Actions support

    Fixes

    • #173 Fix broken gcov command
    • #195 Update Node testing versions
    • #200 Remove flaky tests
    • #204 Create CHANGELOG and remove flaky v4 test
    • #208 Add license scan report and status
    • #220 Remove errant bitly

    Dependencies

    • #189 Bump lint-staged from 10.0.7 to 10.2.11
    • #190 [Security] Bump handlebars from 4.5.3 to 4.7.6
    • #191 Bump prettier from 1.19.1 to 2.0.5
    • #192 Bump mock-fs from 4.10.4 to 4.12.0
    • #196 Bump teeny-request from 6.0.1 to 7.0.0

    ... (truncated)

    Changelog

    Sourced from codecov's changelog.

    3.8.3

    Fixes

    • #329 fix: Test if response has two lines

    Dependencies

    • #306 Bump eslint-config-prettier from 7.2.0 to 8.3.0
    • #305 Bump eslint from 7.21.0 to 7.25.0
    • #302 Bump mock-fs from 4.13.0 to 4.14.0
    • #308 Bump lodash from 4.17.19 to 4.17.21
    • #309 Bump ignore-walk from 3.0.3 to 3.0.4
    • #310 Bump hosted-git-info from 2.8.8 to 2.8.9
    • #325 Bump prettier from 2.2.1 to 2.3.2
    • #326 Bump actions/setup-node from 2.1.5 to 2.2.0
    • #328 Bump lint-staged from 10.5.4 to 11.0.1
    • #330 Bump eslint from 7.25.0 to 7.31.0
    • #331 Bump ws from 7.3.1 to 7.5.3
    • #332 Bump urlgrey from 0.4.4 to 1.0.0
    • #334 Bump husky from 6.0.0 to 7.0.1
    • #333 Bump teeny-request from 7.0.1 to 7.1.1

    3.8.2

    Fixes

    • #304 Add coverage-final.json as a possible coverage file during file lookup

    3.8.1

    Fixes

    • #246 Revert "Bump teeny-request from 6.0.1 to 7.0.0"

    3.8.0

    Features

    • #160 Add Github Actions support

    Fixes

    • #173 Fix broken gcov command
    • #195 Update Node testing versions
    • #200 Remove flaky tests
    • #204 Create CHANGELOG and remove flaky v4 test
    • #208 Add license scan report and status
    • #220 Remove errant bitly

    Dependencies

    • #189 Bump lint-staged from 10.0.7 to 10.2.11
    • #190 [Security] Bump handlebars from 4.5.3 to 4.7.6
    • #191 Bump prettier from 1.19.1 to 2.0.5

    ... (truncated)

    Commits
    • e22061b Merge pull request #335 from codecov/3.8.3
    • 981df8b 3.8.3
    • 135555c Merge pull request #333 from codecov/dependabot/npm_and_yarn/teeny-request-7.1.1
    • 65b53a3 Merge pull request #334 from codecov/dependabot/npm_and_yarn/husky-7.0.1
    • 6e4af4d Bump teeny-request from 7.0.1 to 7.1.1
    • 1149168 Merge pull request #332 from codecov/dependabot/npm_and_yarn/urlgrey-1.0.0
    • 883785c Merge pull request #331 from codecov/dependabot/npm_and_yarn/ws-7.5.3
    • 04d5ff7 Merge pull request #330 from codecov/dependabot/npm_and_yarn/eslint-7.31.0
    • e6c5bf4 Bump husky from 6.0.0 to 7.0.1
    • f781bc4 Bump ws from 7.3.1 to 7.5.3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(6.18.1)
Owner
Max Howell
Max Howell
FutureLib is a pure Swift 2 library implementing Futures & Promises inspired by Scala.

FutureLib FutureLib is a pure Swift 2 library implementing Futures & Promises inspired by Scala, Promises/A+ and a cancellation concept with Cancellat

Andreas Grosam 39 Jun 3, 2021
A Swift based Future/Promises Library for IOS and OS X.

FutureKit for Swift A Swift based Future/Promises Library for IOS and OS X. Note - The latest FutureKit is works 3.0 For Swift 2.x compatibility use v

null 759 Dec 2, 2022
Write great asynchronous code in Swift using futures and promises

BrightFutures How do you leverage the power of Swift to write great asynchronous code? BrightFutures is our answer. BrightFutures implements proven fu

Thomas Visser 1.9k Dec 20, 2022
⚡️ Lightweight full-featured Promises, Async & Await Library in Swift

Lightweight full-featured Promises, Async & Await Library in Swift What's this? Hydra is full-featured lightweight library which allows you to write b

Daniele Margutti 2k Dec 31, 2022
The easiest Future and Promises framework in Swift. No magic. No boilerplate.

Promis The easiest Future and Promises framework in Swift. No magic. No boilerplate. Overview While starting from the Objective-C implementation of Ju

Alberto De Bortoli 111 Dec 27, 2022
Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.

Promises Promises is a modern framework that provides a synchronization construct for Objective-C and Swift to facilitate writing asynchronous code. I

Google 3.7k Dec 24, 2022
Easy Swift Futures & Promises.

❗️ Archived now ❗️ Since Apple released Combine framework, I decide to archive this repo. You still can use this repo as an example of Future/Promise

Dmytro Mishchenko 40 Sep 23, 2022
A promises library written in Swift featuring combinators like map, flatMap, whenAll, whenAny.

Promissum is a promises library written in Swift. It features some known functions from Functional Programming like, map and flatMap. It has useful co

Tom Lokhorst 68 Aug 31, 2022
Tame async code with battle-tested promises

Then Reason - Example - Documentation - Installation fetchUserId().then { id in print("UserID : \(id)") }.onError { e in print("An error occur

Fresh 963 Jan 3, 2023
Lightweight promises for iOS, macOS, tvOS, watchOS, and Linux

Futures Futures is a cross-platform framework for simplifying asynchronous programming, written in Swift. It's lightweight, fast, and easy to understa

David Ask 60 Aug 11, 2022
Futures and Promises library

#PureFutures A simple Futures and Promises library. ##Installation ###Carthage Add the following in your Cartfile: github "wiruzx/PureFutures" And ru

Victor Shamanov 17 Apr 5, 2019
Promise + progress + pause + cancel + retry for Swift.

SwiftTask Promise + progress + pause + cancel + retry for Swift. How to install See ReactKit Wiki page. Example Basic // define task let task = Task<F

ReactKit 1.9k Dec 27, 2022
Promise/A+, Bluebird inspired, implementation in Swift 5

Bluebird.swift Promise/A+ compliant, Bluebird inspired, implementation in Swift 5 Features Promise/A+ Compliant Swift 5 Promise Cancellation Performan

Andrew Barba 41 Jul 11, 2022
A Promise library for Swift, based partially on Javascript's A+ spec

Promise A Promise library for Swift, based partially on Javascript's A+ spec. What is a Promise? A Promise is a way to represent a value that will exi

Soroush Khanlou 622 Nov 23, 2022
Material para a apresentação da palestra "Implementando Interesses Transversais - um papo sobre arquitetura, DI e Design Patterns em Swift/iOS" no TDC Future 2021

--- title: Implementando Interesses Transversais - um papo sobre arquitetura, DI e Design Patterns em Swift/iOS author: Cícero Camargo date: Nov 30th

Cícero Camargo 2 Nov 30, 2021
PromiseKit 4.5.2 with changes for Swift 5

繁體中文, 简体中文 Promises simplify asynchronous programming, freeing you up to focus on the more important things. They are easy to learn, easy to master an

null 0 Dec 24, 2021
Swift µframework providing Future

Future [] (https://github.com/Carthage/Carthage) Swift µframework providing Future<T, Error>. This library is inspired by the talk of Javier Soto at S

Le Van Nghia 122 Jun 3, 2021
A library that adds a throwing unwrap operator in Swift.

ThrowingUnwrap A simple package to add a throwing unwrap operator (~!) to Optionals in Swift. Import Add this to the package-wide dependencies in Pack

Allotrope 3 Aug 27, 2022
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

null 3.3k Jan 7, 2023
Promises for Swift & ObjC.

Promises simplify asynchronous programming, freeing you up to focus on the more important things. They are easy to learn, easy to master and result in

Max Howell 14k Jan 5, 2023