Questions tagged [reactivekit]

ReactiveKit is a lightweight Swift framework for reactive and functional reactive programming.

ReactiveKit is a lightweight Swift framework for reactive and functional reactive programming. https://github.com/DeclarativeHub/ReactiveKit

32 questions
5
votes
1 answer

ReactiveKit: How do you get the values of changed entries for ObservableCollection?

I'm using ReactiveKit 1.x. It has a very helpful ObservableCollection, which allows you to monitor for changes to a collection. In my case, I'm using it with Dictionary The ObservableCollection produces an event of type…
Andrew Theken
  • 3,392
  • 1
  • 31
  • 54
2
votes
0 answers

How to sanitise data with bidirectional binding with Bond

I'm quite new to FRP and decided to get started with Bond and ReactiveKit as it seemed lightweight enough to start gradually applying it to my apps and my head. I have a setup where I have a view, which has an observable State and I have a view…
Danchoys
  • 739
  • 1
  • 8
  • 14
2
votes
2 answers

How to bind array count to replace button image

I'm trying to observe array change and bind it to the image of the button. if the array is empty. set picture of an empty cart. else set image of a cart. so what I did was : let x = itemsArray.observeNext { [weak self] (v) in let image =…
Marry G
  • 377
  • 1
  • 3
  • 16
2
votes
0 answers

Bidirectional Bind to UserDefaults

I am trying to create a bidirectional bind using ReactiveKit/Bond. I am trying to create the bind to the UserDefaults on my View Model, but I am having trouble figuring out how to make that happen. I tried using reactive with the keyPath that…
Olyve
  • 701
  • 1
  • 8
  • 27
2
votes
0 answers

How to create KVO Observables in ReactiveKit

I'm migrating my project from swift 2.3 to swift 3. After days of work I'm left only with one error relating Bond/ReactiveKit. Before the migration I used the following code to create KVO Observables: var myObservable :…
Or Chen
  • 33
  • 4
2
votes
1 answer

ReactiveKit Bond KVO observe UserDefaults

I was previously using RxSwift and I decided I did not want to use it anymore and was able to convert everything over to Bond which I am much more familiar with. Since the new changes though to Bond v5, I cannot seem to figure out how to observe…
Olyve
  • 701
  • 1
  • 8
  • 27
2
votes
1 answer

Binding of model and viewModel in Swift Bond

I am using Swift Bond for two-way binding of view with viewModel. This is achieved by bidirectionalBind. Question is: What is a common practice of binding a model with a viewModel and more specifically how would model know about changes made in…
2
votes
1 answer

Passing a proxy data source in Bond5 tableview/collectionview binding

With Bond 4.x it was possible to pass my custom data source when binding a tableview to an ObservableArray in order to implement custom invocations of UICollectionViewDataSource methods (e.g. viewForSupplementaryElementOfKind) like…
MrBr
  • 1,884
  • 2
  • 24
  • 38
2
votes
1 answer

How to use ReplaySubject in ReactiveKit

I have this in RxSwift: func foo() -> Observable { let subject = RxSwift.ReplaySubject.create(bufferSize: 1) return subject.asObservable() } How do I implement the same concept in ReactiveKit?
Daniel T.
  • 32,821
  • 6
  • 50
  • 72
1
vote
1 answer

Wrapping asynchronous code in Swift's Combine publisher

I have a class called QueryObserver that can produce multiple results over time, given back as callbacks (closures). You use it like this: let observer = QueryObserver(query: query) { result in switch result { case .success(let…
Kevin Renskers
  • 5,156
  • 4
  • 47
  • 95
1
vote
1 answer

How to turn a standard model class/struct into observable properties?

I am using ReactiveKit with their Bond extension, and I can't really figure out how to do something that feels kind of basic. Let's say I have a User model in my app. Something like this. class User: Codable { var id: String var firstName:…
Kevin Renskers
  • 5,156
  • 4
  • 47
  • 95
1
vote
1 answer

ReactiveKit: observe an array of signals, do something when they are all completed

I am pretty new to reactive programming, and am using Bond with ReactiveKit in my app. I am now running into a problem that I can't quite figure out. The problem is that on a certain page I have to upload a number of images, and when all images are…
Kevin Renskers
  • 5,156
  • 4
  • 47
  • 95
1
vote
1 answer

Swift iOS ReactiveKit: calling the observer causes to trigger action multiple times?

I have Singleton class to which i have used to observe a property and trigger next action. Singleton Class: public class BridgeDispatcher: NSObject { open var shouldRespondToBridgeEvent = SafePublishSubject<[String: Any]>() open var…
1
vote
0 answers

Type does not conform to protocol QueryableDataSourceProtocol

I'm upgrading from Swift 2.3 to 3.0 (in Xcode 8.2.1), so I've updated the podfile (to no longer restrict the versions of the pods). My project uses Bond ( https://github.com/ReactiveKit/Bond ), and the current version of Bond is 6.2.8, which fails…
DarkByte
  • 1,162
  • 8
  • 17
1
vote
1 answer

Computed Observable In ReactiveKit/Bond

Is there some kind of Computed Observable in ReactiveKit Or Bond? Does initializing an Observable with a native Swift computed property will act the same?
Dorad
  • 3,413
  • 2
  • 44
  • 71
1
2 3