Code Monkey home page Code Monkey logo

Comments (6)

balecrim avatar balecrim commented on May 8, 2024 1

Hi @s4cha, first of all, sorry for the radio silence lately, I haven't had as much time lately to help out. I'll look into your feedback on #51 and try and reproduce the differences between our environments and be sure to let you know ASAP what I find out.

from then.

s4cha avatar s4cha commented on May 8, 2024

@bernardowilson First of all thank you so much for taking the time to issue a PR, this is really appreciated :) I've had to relax the timings locally as well when testing with swift 5, it's not a big deal.

Concerning the breaking changes I need to check what's going on, we'll do that on #51.

PS: I'm currently trying to update to the latest Xcode at home with a terrible network connection might take some time ;)

from then.

arden avatar arden commented on May 8, 2024

When will swift5 be supported ?

from then.

v-ksenofontov avatar v-ksenofontov commented on May 8, 2024

How about such a minimal revision?

extension Promise where T == Void {
    
    public convenience init(callback: @escaping (
        _ resolve: @escaping (() -> Void),
        _ reject: @escaping ((Error) -> Void)) -> Void) {
        self.init()
        setProgressCallBack { resolve, reject, _ in
            //swift 5 build fix:
            callback({
                resolve(())
            }, reject)
        }
    }
    
    public convenience init(callback2: @escaping (
        _ resolve: @escaping (() -> Void),
        _ reject: @escaping ((Error) -> Void),
        _ progress: @escaping ((Float) -> Void)) -> Void) {
        self.init()
        setProgressCallBack { resolve, reject, progress in
            //swift 5 build fix:
            callback2({
                resolve(())
            }, reject, progress)
        }
    }
}

from then.

s4cha avatar s4cha commented on May 8, 2024

@vksenfontov eagle eye, indeed that's what I had on my side that enables migrating without all the changes highlighted on #51
here is mine for reference:

extension Promise where T == Void {
    
    public convenience init(callback: @escaping (
        _ resolve: @escaping (() -> Void),
        _ reject: @escaping ((Error) -> Void)) -> Void) {
        self.init()
        setProgressCallBack { resolve, reject, _ in
            let wrapped = { resolve(()) }
            callback(wrapped, reject)
        }
    }
    
    public convenience init(callback2: @escaping (
        _ resolve: @escaping (() -> Void),
        _ reject: @escaping ((Error) -> Void),
        _ progress: @escaping ((Float) -> Void)) -> Void) {
        self.init()
        setProgressCallBack { resolve, reject, progress in
            let wrapped = { resolve(()) }
            callback2(wrapped, reject, progress)
        }
    }
}

from then.

s4cha avatar s4cha commented on May 8, 2024

@arden it is now :)
@bernardowilson Congrats ! Thank you so much for you work 🥇

Release: https://github.com/freshOS/then/releases/tag/5.0.0
Pod: https://cocoapods.org/pods/thenPromise)

Closing this for now, don't hesitate to reopen if needed :)

from then.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.