Giter Site home page Giter Site logo

Comments (8)

RomanPodymov avatar RomanPodymov commented on June 2, 2024 1

Hello @yunjinghui123
In your example v is not BOOL, it's id. Just change argument type in your example.

from promisekit.

yunjinghui123 avatar yunjinghui123 commented on June 2, 2024 1

Hello @yunjinghui123
In your example v is not BOOL, it's id. Just change argument type in your example.

Thank you

from promisekit.

mxcl avatar mxcl commented on June 2, 2024 1

I guess I added it years ago for some reason.

It should work like the other then() and automatically convert from id to BOOL based on the provided args, but at this point I think we can all agree this “bug” is working as intended.

from promisekit.

RomanPodymov avatar RomanPodymov commented on June 2, 2024 1

@yunjinghui123 So you can use NSNumber in your example

void (^fetch)(PMKBooleanAdapter) = ^(PMKBooleanAdapter block){
    block(YES, nil);
};
[AnyPromise promiseWithBooleanAdapterBlock:fetch].then(^(NSNumber* obj){
    XCTAssertEqualObjects(obj, @YES);
});

from promisekit.

yunjinghui123 avatar yunjinghui123 commented on June 2, 2024 1

fetch

I will use it this way.Thank you!

from promisekit.

mxcl avatar mxcl commented on June 2, 2024

it's a bug based on our docs. I don't remember this function, did you add it @RomanPodymov ?

from promisekit.

RomanPodymov avatar RomanPodymov commented on June 2, 2024

it's a bug based on our docs. I don't remember this function, did you add it @RomanPodymov ?

Hello @mxcl
I also don't remember this function, but I think I explained @yunjinghui123 what is wrong. @yunjinghui123 can we close the issue?

from promisekit.

RomanPodymov avatar RomanPodymov commented on June 2, 2024

Hello @mxcl
As I can see promiseWithBooleanAdapterBlock uses [NSNumber numberWithBool:] because AnyPromise uses id for value.

from promisekit.

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.