Comments (7)
Hi @serluca thanks for pointing this out.
Currently throttle
was an approach mimicking the implementation of ReactiveViewModel
.
Right now we have more operators on RxSwift
that could be used to accomplish this in a better way.
Haven't checked recently but chances are you are correct and the current behavior is not working 💯 of the time as one would have expected it to.
I'll give it a try again with the new operators and will fix it as soon as I can.
from rxviewmodel.
Hi @esttorhe
Not sure if can help but let me tell you my experience with RxViewModel
(I'm having this on the latest release 3.1.3
and also on the pre-release 3.1.4
).
As I said, I noticed that throttleSignalWhileInactive
it fires signals while the active
property is false. I also noticed that it doesn't fire as soon as my subject it sends the next signal, but there is a bit of delay. I looked into RxViewModel
and I found that there is a property let throttleTime: NSTimeInterval = 2
.
So it seems that the signal is not throttled waiting the didBecomeActive
, but it fires when the throttleTime
expires.
from rxviewmodel.
Yes thanks @serluca; I finally got some time off this week and I'll try to replace the throttle
mechanism to use the pre defined throttle
operator instead of rolling my own like I did when I first created this.
I'll try to release v. 3.1.5 by EOW.
If you would like to give it a try and know a version that uses the predefined operator and submit a PR
that would be amazeballs 😬
But if not i'll be releasing this new version soon
from rxviewmodel.
Is there any status update on this? throttleSignalWhileInactive
would be very helpful, provided it works!
from rxviewmodel.
OK; I've finally had some time to seat down and check the issue.
I change a little bit the behavior but everything is working as expected.
@serluca you are correct in your analysis that it will throttle based on the timer set.
This is the default behavior of the throttle
operator (throttle
only does it for a period of time).
The convenience operator throttleWhileInactive
basically means that it will throttle the signal whenever the viewmodel is inactive (with a predefined period of time of 2 seconds)
TL;DR;: That part is working as designed.
On the other hand it shouldn't fire a signal when the property is set to false
; I tested it locally and on a couple of machines and couldn't reproduce this behavior, could you provide a sample code that actually demonstrates that it's firing an event when set to false
?
from rxviewmodel.
Hi @esttorhe
I'm currently in vacation, I'll try to send one as soon as possible, but based on what you have just described maybe is not an issue. I'll get back to you.
Thanks
from rxviewmodel.
I'm going to be closing this issue.
Please feel free to open another one if you still think this is a bug
from rxviewmodel.
Related Issues (20)
- Better Carthage support HOT 1
- Fix broken CI HOT 1
- Fix Codecov.io
- Update to rxswift & rxcocoa 2.2? HOT 2
- Fix the CI HOT 1
- RxViewModel is depending on an old version of RxCocoa HOT 3
- Retain cycle HOT 1
- Carthage minimum deployment target 8.3 HOT 2
- Add test for Carthage builds
- Update Swift 3 HOT 6
- Carthage fails to build HOT 2
- Change CI provider HOT 3
- You should make RxViewModel class "open" HOT 3
- Unable to use when inherited HOT 9
- Update podspec on cocoapods repo HOT 7
- Can't use RxSwift 3.6.1 HOT 4
- README for non-ReactiveCocoa devs? HOT 1
- Update with RXSwift 4
- Unable to run the demo
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 rxviewmodel.