Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Javier Domingo Cansino
    @txomon
    so that I can substitute the code from the example to:
        @Override
        public boolean onNavigationItemSelected(MenuItem item) {
            // Handle navigation view item clicks here.
            int id = item.getItemId();
    
            if (id == R.id.nav_explore) {
                navigationInputObservable.onNext("explore");
            } else if (id == R.id.nav_custom) {
                navigationInputObservable.onNext("custom");
            }
    
            // ...
            return true;
        }
    or something like that
    Dorus
    @Dorus
    (navigationInputObservable instanceof Subject) == true
    Or, make is a Observer.
    Subject.asObserver()
    Do RxJava subjects have that function?
    Else (Observer)Subject
    Javier Domingo Cansino
    @txomon
    the thing is that createSomethingThatLetsMeEmitLater doesn't exist
    I don't know how can I create an observable or whatever that let's me call an onNext() on it
    Javier Domingo Cansino
    @txomon
    I will try to generate some code that helps me explain myself...
    Dorus
    @Dorus
    Did you read the stuff on Subject?
    Javier Domingo Cansino
    @txomon
    yes, but maybe this is a problem on my java knowledge
    Dorus
    @Dorus
    Javier Domingo Cansino
    @txomon
    oh gosh
    that was really far in history xD
    Dorus
    @Dorus
    Yeah i have no time to make a code sample now, and i knew i wrote one with a subject before :)
    Javier Domingo Cansino
    @txomon
    yep
    it's enough
    knowing that I can use a Subject as a Create now, publish later is enough for me
    Dorus
    @Dorus
    That one uses a Observer<Observable<Integer>>, but it's easy to replace it with an Observer<String> or whatever.
    Javier Domingo Cansino
    @txomon
    yeah yeah
    it's just what I needed
    thank you!
    Dorus
    @Dorus
    :)
    And now dont go abuse Subjects. Share them as Observer if at all.
    Javier Domingo Cansino
    @txomon
    hahaha suuuure....
    xD
    nah, anyway, I now need to know what should I do
    because I feel like creating an Observable for each config value is maybe overkill
    and I should maybe generate something like ConfigurationObservable
    and have Map<String,Object> passed around
    each one publishing it's values, and then using a combineLatest in the BS
    and have a bs.getConfigurationObservable(List<String> interestingConfigs) function
    so that it only receives the values from those interestings ones
    Javier Domingo Cansino
    @txomon
    that way the BS is in charge of deciding what sort of items should emit...
    Dorus
    @Dorus
    How offten do config values change?
    Javier Domingo Cansino
    @txomon
    @Dorus not really frequently, but I want to do everything reactive, because I might implement backends in the app, so config sources may vary and be changed anytime really
    so having the UI change the config value, would mean actually almost the same as the backend changing it
    Leander Kurscheidt
    @LeanderK
    is there a web framework, where the answer is decoupled from the request, so that i can have observable streams of the requests and zip some, map some and in the end answer them with the result
    Abhinav Solan
    @eyeced
    Hi all, I am trying this code
    Observable.just(1, 2, 3, 4, 5, 6)
    .groupBy(i -> i % 3)
    .flatMap(o -> o.first())
    .subscribe(System.out::println);
    Now this should have just got me (1, 2, 3) as the result but it is giving
    1
    2
    3
    4
    5
    6
    Dorus
    @Dorus
    Possibly, first() unsubscribes so groupBy recreate the group?
    Try .distinct(i -> i % 3) instead.
    Abhinav Solan
    @eyeced
    is that a bug ?
    Dorus
    @Dorus
    I'm not 100% sure. Let me test what Rx.Net does.
    yup, Rx.Net gives 1,2,3 as expected.
    I would suggest you fill a bug and see what the devs say about this. Seems fishy.
    Abhinav Solan
    @eyeced
    ok thanks
    Dorus
    @Dorus
    #3411
    Dorus
    @Dorus
    I've read up on it a bit, ther's something to say for both implementations. The Rx.Net variant is the one you would expect, but the RxJava has some uses too. Mainly not leaking resources.