Comments (3)
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.
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 AnyObject
s and thus the DisposeBag
s 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.
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)
- I got a problem HOT 1
- Swift 3 2.0.0 CocoaPods release? HOT 2
- New release? HOT 2
- Update podspec
- Problems at release a new version at CocoaPods HOT 2
- Allowing set on disposeBag HOT 7
- rx.disposeBag may be using wrong address HOT 7
- Support for RxSwift 4.0 HOT 3
- Switch CI to Circle
- Carthage support HOT 1
- Move to CircleCI 2.0
- swift 5 adapter HOT 3
- Remove Carthage from Circle CI build
- Build project in CI for other platforms not only iOS
- iOS Crash, memory management error HOT 1
- NSObject-Rx version 5.0.0 released? HOT 5
- SwiftPM support HOT 3
- Can't compile with Cocopods and Xcode 12 HOT 2
- why i can't use rx.disposeBag, just rx_disposeBag HOT 2
- Release new version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsobject-rx.