-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Signal for unique values only #1286
Comments
|
Top notch response time. Thank you @jspahrsummers =] |
@jspahrsummers Would it a good idea to add this Q/A to the filtering or appropriate section of the online documentation? |
The operator itself is documented, and it's used in a lot of examples and past Q&A. I'm not sure where else we could fit it in. |
Well I hope this question and answer serves as documentation enough that users looking for 'unique values' will be pointed to this very useful operator. |
new to RAC, liking its potential, totally not getting the context of the name "distinctUntilChanged" .. It almost seems like it needs to be oppositely named. As it returned a distinct value when the the value changes to another value, it might actually be distinctWhenChanged. I can learn to understand it of course, but is ain't intuitive. |
@wdcurry The Swift API calls it |
Thanks @jspahrsummers .. now that is more immediately understandable.. |
I want to filter values based on the Suppose I have a signal
RACSignal *original = ...; // sends values [1,1,2,2,3,3,3,3,3,3,3,4,4,4,3,3,1,2]
How can I create a signal
filtered
such that it sends values ofs
only if it's changed from the previous value? i.e.RACSignal *filtered = [original ...]; // sends values [1, 2, 3, 4, 3, 1, 2]
My RAC intuition tells me I can do this with one of those
mapWithPrevious:
or whatever methods, but I'm not very sure how they're used.The text was updated successfully, but these errors were encountered: