Giter Site home page Giter Site logo

Comments (5)

erichoracek avatar erichoracek commented on April 28, 2024 1

When I was updating the annotations, I checked this behavior. Returning a RACSequence from within the block provided to a -[RACSignal flattenMap:] will cause a crash. See https://github.com/ReactiveCocoa/ReactiveObjC/blob/master/ReactiveObjC/RACSignal.m#L108-L176 β€” specifically that the bindBlock()'s return value is cast to a RACSignal * and subscribeNext: is invoked on it, which is only available on RACSignal, not RACSequence.

It would appear that flattenMap: is not truly available on RACStream since bind: is not implemented on RACStream (subclasses must implement it). It seems best to think of RACStream as an protocol with some extensions that RACSignal and RACSequence both share, but they are generally not interoperable in practice.

from reactiveobjc.

mdiep avatar mdiep commented on April 28, 2024

Maybe? I think this was done to make generics work well.

Are you actually returning a RACStream?

from reactiveobjc.

beloso avatar beloso commented on April 28, 2024

I am not returning a RACStream, I've noticed the change when migrating. All my flattenMaps were returning RACStream, but I always return a RACSignal. A simple find and replace fixed this for me.

I just wondered if the change was deliberate or a mistake perhaps.

from reactiveobjc.

beloso avatar beloso commented on April 28, 2024

I changed to ReactiveObjC specifically for the generics. So there is no need to change this back to RACStream on my end.

from reactiveobjc.

beloso avatar beloso commented on April 28, 2024

Thank you for your awesome explanation. It does indeed make sense to have change it to a RACSignal. I've never returned anything else actually.

from reactiveobjc.

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.