« first day (2358 days earlier)      last day (2605 days later) » 

A K
10:02 PM
guys, i'm back; and do you remember that interhitence problem i had?
my boss made a fcking error issuing it to me
he dun fcked up and had me solve it with proto
and then changed it for a different concept that took 30 seconds to solve
huge waste of time
 
@KevinDuke moment
 
@rlemon lol wtf
 
@taco people are trolling the pc master race area
 
user2620028
10:21 PM
oh thank god
 
It was inevitable gonna say masterbate at some point
 
it's crazy, given the timer, how much it is being changed
 
I'm surprised there aren't more dicks
 
trying to turn the S in pc master race into a swastika
 
10:36 PM
I gotta find an open spot to draw a dick
The middle of the argentinian flag will have to do
 
Can someone please explain how the hell this code emits 1,2,3 ?
var source = Rx.Observable
    .range(1, 2)
    .flatMapLatest(function (x) {
        return Rx.Observable.range(x, 2);
    });
There is not 3 in here , and range 1,2 is 1
 
my timer got removed somehow
and I made a swastika
 
@Royi the second argument is count, not end
 
^ so ? still how come 3 ?
 
10:41 PM
range(2, 2) -> 2, 3
 
what happens here first ? the range or or the inner range ?
(line 2 or 4)
 
nothing happens until something subscribes to the observable
 
anyone got plans tonight
 
movie night
 
the range in line 2 will emit (1, 2)
 
10:43 PM
@Mosho for each item in line 2 , there are emits from line 4 ?
 
@Mosho Yeah it will emit 1,2 , but right after it emits 1 , the flatMapLatest will emit 1,2 . And then the 2 ( from line 2) will become range (2,2) so eventually we have 1,2 + 2,3 right?
 
yeah but it will only emit 1 from the (1, 2) because of the Latest bit
it's a little shitty in this case
since timing is weird since it feels sync
it's basically like this
 
I think I have a new philosophy.
 
But who said that the 2 from 1,2 is the same 2 from 2,3 ?
This is an object ,not a value ( so how come object(2) ===anotherObject(2) ? )
 
10:51 PM
Everyone should get the 4 essentials (food, shelter, education, and healthcare) for free. Beyond that, I don't care.
 
1. first iteration of the callback that `flatMapLatest` was called with is called, observable is returned
2. first item from the observable (in line 4) from the first iteration is emitted
3. second iteration of the callback is called
4. first observable (from step 1) is discarded
@Royi it's not the same 2
the 2 from (1, 2) was never emitted
 
oh
 
it's a confusing example
try this one:
var source = Rx.Observable
  .range(1, 3)
  .flatMapLatest(function(x) {
    return Rx.Observable.from([x + 'a', x + 'b']);
  });

var subscription = source.subscribe(
  function (x) {
    console.log('Next: %s', x);
  },
  function (err) {
    console.log('Error: %s', err);
  },
  function () {
    console.log('Completed');
  });

// Next: 1a
// Next: 2a
// Next: 3a
// Next: 3b
// Completed
 
I think I got it but let me see if i'm right. In my first exmple , line #2 emits value , then line #3 is running , then line #2 emits another value and then again line #3 is running .......Right ?
That's why 2 from first iteration was disposed (IIUC)
 
I don't think it's healthy to look at it like that
lines aren't running
 
10:55 PM
emiting
 
what the code does is set up "wiring" between observable streams
and when the an observable is subscribed to, everything flows
 
whenever a new item is emitted by the source Observable, it will unsubscribe to and stop mirroring the Observable that was generated from the previously-emitted item, and begin only mirroring the current one
 
right
 
Buzzfeed is a penis seat
 
11:01 PM
you're just trying to get me to say "youre a penis seat" but im not falling for it
 
@Meredith must be why @BadgerCat and @copy are moving
 
@Royi the whole point is to not think about the timing.
If you're doing Rx and use flatMapLatest you should use it for its intended use case - which is rarely with synchronous streams unless it's making a decision based on what you passed it.
 
but I like time
 
(Also it's switchMap)
 
11:17 PM
@Shmiddty we love penis seats?
 
@BadgerCat if you loved them, wouldn't you stay in mexico?
 
@BenjaminGruenbaum Still I don't understand the sequence here:
var source = Rx.Observable
    .range(1, 2)
    .flatMapLatest(function (x) {
        return Rx.Observable.range(x, 2);
    });
 
@Shmiddty We're staying
 
@Royi do you understand it without the flatMapLatest?
 
@BadgerCat well, that settles it. Penis seats are so in
 
11:19 PM
With latest it's just like a .map(a=>a1)
 
flatMapLatest is useful for switching sources when something happens - in your case both the thing happening and the observable returned are synchronous - so it's not an interesting example.
 
Still does the flatMapLatest occurs for each item in the range ?
 
Imagine instead of range(x, 2) you'd make a web request there, and instead of range(1, 2) those were user clicks. flatMapLatest would let you only care about the latest web request when you subscribe and will cancel the older requests for you (since it's disposable).
So you only care about the latest click. For example consider:
Rx.Observable
  .fromEvent(".category", "click"))
  .flatMapLatest(e => getPageFromServer("/categories/" + e.target.value)
  .subscribe(content => document.querySelector("#current").innerHTML = content);
Here, flatMapLatest is useful, in your example you're just wondering how the default scheduler works - but the point of Rx is that you don't care about these things.
You just say what sequence things should happen in and it does them in that sequence.
 
^ so it actually stops the "old-irrlevant- orphans" clicks ?
 
@Royi that's why it's such a nice idea. Want to see an example with illustrated graphics?
jsfiddle.net/y63p8b9b - I built this 2 years ago, it illustrates flatMapLatest being useful.
 
11:24 PM
Yeah but can you please ("like you said- scheduler") explain wahta's going on here in the range example ^ ?
I saw it on your presentation :)
 
scheduler POV can you please explain what's going in here ^ ( in the range example) ?
 
No, because it's irrelevant - it's relying on behavior that wouldn't exist in real Rx code - if you're not dealing with time then you typically want flatMap or concatMap rather than flatMapLatest (which will receive all values, rather than drop "obsolete" ones). There is no meaning to "obsoleting" here.
@Mosho's explanation is both complete and correct in what the scheduler does here.
 
@BenjaminGruenbaum Neat.
 
Also with async iterators :)
@Luggage thanks :)
 
Took me to 1:52 to realize
 
🙄
 
yeah...
I need another name for props
that is as short and catchy
I was thinking propses or propsies
not srs
attrs? angular flashbacks
 
'butes
 
params
settings
 
11:49 PM
mmm maybe params
or instead of hacking it like that
I could use the ! postfix operator
this.props.foo! vs this.params.foo everywhere
 
@BenjaminGruenbaum took me about 15 seconds too long to realize
 
Wow 8 pm and I havent started drinking yet
I gotta get going
 

« first day (2358 days earlier)      last day (2605 days later) »