Giter Site home page Giter Site logo

Non-NSObject type support about nsobject-rx HOT 3 CLOSED

tuyendv2 avatar tuyendv2 commented on September 6, 2024
Non-NSObject type support

from nsobject-rx.

Comments (3)

ashfurrow avatar ashfurrow commented on September 6, 2024

Good question! The library currently relies on the Objective-C runtime's associated objects feature, which as far as I know doesn't have an equivalent for Swift-only types. The only solution that comes to mind is to use a global lookup table (a static dictionary [AnyObject: DisposeBag]). It's... not a great solution 😅 But I'd really like this feature on non-ObjC types, too. I'll think about other solutions, and if anyone has suggestions, we're all 👂s

from nsobject-rx.

solidfox avatar solidfox commented on September 6, 2024

Isn't the Obj-C runtime's associated objects feature basically a global lookup table? So as far as smelly global state goes it's the same smell. Problem is that [AnyObject: DisposeBag] would keep the AnyObjects and thus the DisposeBags in memory forever since we have no weak pointer dictionaries in swift yet. Once we have that I believe such a solution would be sleeker than the rather archaic associated objects feature.

from nsobject-rx.

freak4pc avatar freak4pc commented on September 6, 2024

I don't think this is a super achievable/needed thing for RxSwift >3 because the way Reactive parts are in extensions of the Reactive protocol which are bound to NSObjects as well (e.g. element.rx.observable).

Since this hasn't been active for a year now, I'll be closing this. If you feel like we should re-open the discussion we can re-open.

from nsobject-rx.

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.