« first day (2243 days earlier)      last day (2699 days later) » 

6:01 PM
@FlorianMargaine I still don't get it... I must be stupid
 
@FlorianMargaine I was with them up until the end: "every callback which could potentially be called asynchronously, gets wrapped"
that feature will lose a ton of value if you have to wrap every callback
 
@corvid mobx is to redux as react is to angular. It does less, but does it well (and differently).
I use it. BenjaminGruenbaum does. I think a few others in here do.
 
So, what is being observed, exactly?
 
values. Are you familar with react's internal state (this.getState()) ?
 
@corvid the stream of changes
 
6:07 PM
(mobx isn't react-specific, but you use react so I'm going to talk about it that way)
 
Okay, so it observes changes to state and does what with them?
 
@Luggage how similar is it to Object.observe() because that's how i understand it
 
argh, too many directions.
 
@bitten ehhhhhh only somewhat
 
theoretically similar though?
 
6:08 PM
@corvid well.. if you were using mobx-react, instead of this.setState() you could just this.someProperty = newValue; and it would know what (if anything) to re-render.
maybe I shouldn't have talking about mobx-react first.
 
but, isn't that what react does?
 
@bitten yes, but only in algorithm, not data. Rather than passing the change that happened, you get some set of the state.
 
No.
let's back up.
forget react.
 
@ssube alright
 
@bitten it's less granular than Object.observe was
 
6:09 PM
@SvenvandeScheur @Shmiddty Sorry I disappeared - I had an important meeting come up. I think I have an idea on how to proceed, trying to call .focus() on the element I want active directly instead of using Enzyme's .simulate(). Thanks for the help!
 
the underlying concept is that you know a 'foo' just happened and have the previous state, so now it's up to you to derive the new state from the old
 
mobx lets you make an object with properties that can be 'observed'. You can make an event that ges notified when foo.bar = newValue;. this alone isn't special but...
It can also smartly know what other functions need to be re-ran. Say we have a function:
function safeAge(realAge) { return realAge / 2 + 7; }
 
@Luggage I'm curious how it does that.
just how it goes about building this minimal call tree when it doesn't really know what is bound where
 
We could make that a computed property on our class:
{
    @computed
    get safeAge() {
        return this.realAge / 2 + 7;
    }
}
@ssube the dependency tracking is the magic. magic that knockout.js shares.
and I don't think reactive extensions has somethign liek it, but I could be wrong
 
@Luggage I don't trust wizards.
 
6:14 PM
@corvid with that property (getter) above mobx will know when to re-calculate it and when not. If using react <div>{this.safeAge}</div> mobx-react would know to re-render when this.realAge is changed, but not when this.someOtherProperty
There must be a better explanation out there than I can pulling out of my ass..
 
i understood object observe like "watch this object and run this callback when it changes", with mobx, could you say "watch this observerable and run this observer's render function when it changes"?
 
have you looked though the tutorial /walkthough? mobxjs.github.io/mobx/getting-started.html
 
That kind of makes sense, but aren't observables a relatively common and liked pattern? What separates mobx? Just doing it well?
 
@bitten seems conceptually right
obviously it's more complex than that, cause you can use it without react
@corvid observables are pretty good, yeah
 
@bitten yes, or even more complex. "if this objservable changes, then I must recompute these other functions or re-render these other children, but no others)
 
6:16 PM
@ssube i've only been looking at react specific stuff
 
@corvid the magic of mobx is the automatic dependency tracking. in that example above, mobx saw that I used this.realAge and not this.name and so it knows that depends on what.
 
so an example of this pattern would be like "triggers" in a video game. Whenever the position of a player changes, and it is in these bounds, then update the game state in some way?
 
kinda...
 
@corvid that kinda sounds more like an event emitter
 
well, observables are like an event emitter..
 
6:18 PM
in fact, in a well-structured app, wrapping event emitters into observables is a Very Good Thing
especially for user events
 
@Luggage yeah true, but the observable doesn't update the game state. something else updates an observable which triggers a re-render
i only really know mobx-react
 
@bitten the observable is the game state
 
class MyClass {
    @observable name;
    @observable favoriteColor;
    @observable homeTown;

    @computed //will recompute if name or homeTown changes, but not favoriteColor
    get greeting() {
        return `My name is ${this.name} and I am from ${this.homeTown}`;
    }
}
 
or wraps it, at least
with a game example, you might have three observables for the mouse, keyboard, and gamepad, another observable to merge them and map the raw input to game commands, then mobx will watch and react to those changes, update your game state, and trigger a render
 
render() {
    // will not re-render if favoriteColor changes, because greeting does not depend on it
    return <div>{this.greeting}</div>;
}
 
6:21 PM
@ssube yeah, but it's not like observables trigger actions. or do they?
 
@bitten for any observable system, the inputs and outputs are eventually observables (tl;dr: yes)
 
@Luggage yeah that's nice how it does that
magic
@ssube ah i'm not familiar with observable systems at all
it sounds nice though, i just can't see it
know any code examples?
 
I don't mean "observable system" as one phrase, just any system of observables.
 
omg brb my mug just.. cracked and the bottom gave out
 
You can make a mess of mobx-react, though. It's a tool, but not an opinionated way of managing state like redux is.
 
6:25 PM
Think of observables like a river: it may come from one source, many sources, may split, join, run through a toxic waste dump and turn bright colors, but it continues flowing and you can watch the output go by.
If you pour a glass of water (a promise that resolves once) into a river, it will work just fine, but nothing much will happen.
 
...catch on fire..
 
mobx is the city plumbing system that draws from that river, vanishes, and ends up in your house with fine temperature control
 
is it bad to not eat for a couple of days so I can lose 1.5lbs to be under a certain weight? It's not anorexia if it's for a couple of days, is it?
 
@ssube lol
 
if you are generally healthy, your body can take it..
 
6:27 PM
@ndugger juust burn more calories than you eat
 
I can't speak for how good of a strategy it is.
 
@bitten you laugh, but mobx takes care of the pressure and delivery, routing, plumbing, etc. It's not dissimilar.
 
it's just a great analogy
is the observable the stream? i'm still kinda stuck on object.observe where this thing takes an object and then runs a callback
 
ignore object observe, it was a garbage method for garbage people
 
6:30 PM
observables are the stream, river, whatever size it takes. They are a flow of data.
 
Well, I wasn't able to exercise for a few months because of health issues, so I gained back most of the weight I lost, but then I got sick and didn't eat for a few days and lost a good bit of weight, and now I'm almost back down to my weight before I stopped exercising, so I want to lose that last 1.5lbs again
 
@ssube yeah i'm trying
 
observables are promises you can loop on
 
6:31 PM
and they take data/a variable?
 
they're just a formalized version of what event emitters already did
 
it's time for you to go jsfiddle with it yourself.
 
@bitten they take some input, usually by watching something, like the on('click', ...) of an emitter.
 
I spent the entire morning in a secure building.
 
but they take multiple inputs over time and produce multiple outputs, plus their inputs can be observables (streams) of their own
hence the river analogy with the joining and splitting
 
6:32 PM
well, mobx is more of a 'value changed' type of observable and not good for click events..
 
Turns out when you don't have your phone or computer, you focus more in a meeting.
 
by the time it hits mobx, you have a full river of changes that have been collected from across the app
 
who would have guessed?
 
@SterlingArcher that sounds horrible.
working on my mobx-knockout library, now..
 
alright, i think i'm taking it in
 
6:35 PM
trying to make a mobx modifier to wrap KO observables..
because I like punishing myself
 
just take everything you've learned about promises and everything you know about loops and just sort of combine them
 
@ssube "Nothing." well that's a short article
thanks
 
there's a reason people usually show them in a square split into quads
 
i also like how michel uses promises in his views
 
if private fields make it through without using the private keyword and using something retarded like the pound symbol, I would fucking lose my shit.
 
6:37 PM
how he switchs over the promise's state
i thought that was really clever
view.document being a promise
 
> please man i only need a little bit of help and ithen i can go on
You don't know how to resize a bitmap, I don't think you need a "little bit" of help
 
LOL
I would have to agree
> why is it fuzzy now?
 
well no
not if he doesn't know how to resize it
 
@bitten that's just a router, in its most basic form
 
but using the promise to run it, i liked it
i think with that example, view.document is made with fromPromise
 
6:47 PM
I think that's a little shady, since promises don't necessary have that
 
yeah you wrap it with the above ^^
 
ahh yeah you're looking at mobx
 
view = { document: fromPromise(new Promise(/* */)) }
 
mobx is the shit
chose that over redux, so happy I did
 
or whatever
 
6:48 PM
observables from promises have very little use in new code, in my experience
if you're wrapping older stuff to make it work with observers, they are handy, but usually you want to just deal with observables directly (or through mobx)
 
yea, this is just a helper for a common pattern of setting a 'loading' observable or the like.
this.loading = true;
doSomethingAsync().then((result) => {
    this.data = result;
    this.loading = false;
})
 
if you ever have a promise and are interested in seeing the progress of it, you really have an observable
 
true.
 
@ssube ooo
 
same with producing promises in a loop, most cases where you're looping over promises
really anything promise-related that you do more than once, it's observable
 
6:53 PM
@ndugger you used Mocha/Jasmine, right? it's not the best example, but the magic there was that whenever you call describe(), it(), etc. the test runner keeps a stack of contexts so it can associate some data with the test cases as they are gathered
str8fwd because everything is evaluated immediately, when a test is eventually ran on some separate stack, you have all the data to provide information what exactly failed
 
neither mocha nor jasmine run concurrent tests
they don't need to worry about context
 
str8fwd ? come on.
 
(did say it was a bad example)
anyways, you have an HTTP server, some DB write failed, catch the exception on the process, boo-hoo no information about the incoming request to evaluate the payload that caused a flop
so enter zones, we have something in the context that's keeping track of the call stacks so we can maintain some context without pushing that information into each callback
 
or it's just a singleton
 
well, we'll have to wrap each callback so that when it enters it has the correct zone information, but at least it streamlines things and we don't have to change the signatures
 
7:00 PM
you're a singleton.
@ss how many days left?
 
eh, 3ish
 
today's smbc made me want to go to starbucks and get some mint contraption
or that other place.. peet's
 
the worst part about your last few days is the boredom
I've already written down everything I do and given away all my desk trinkets
what do now?
 
I was always frantically documenting and fixing little things I forgot I did until the end
ok, that's not true.. that was jsut the last shithole that I on;y stayed at 6 months at.
the fact I was there 6 months, gave 1 month notice and then even came in one extra day to help on invoicing day was why I quit that place.
 
lol
that's a lot of shit to get involved with and become indispensable in 6 months
 
7:08 PM
yea.. well.. they are perpetually understaffed and mismanaged.
 
at least this place is perpetually overstaffed until the annual spring layoffs
 
still are. I still deal with them since I contract for them.
but I deal with them in a much more stress free way, on my terms.
I quit and said "I'll still work on the projects I choose for as many hours as I choose at 20% higher than my previous rate." They agreed. That's my boasting for the month.
 
I'm curious if this place will try to do that. They've done it on a couple other people before, all of whom were more single-point-of-failure than me, but not by much.
I do know that a few tools will start to melt down, mostly because of how devs are using them and what I've been preventing them from doing.
we have a couple devs who refuse to use maven dependencies because "they aren't reliable" and just check out a half-dozen repos into specific paths for a build
 
class ScrollableFeed {
  @observable scrollPosition;
  constructor() {
    window.addEventListener('scroll', this.onScroll);
  }
  onScroll = e => {
    const { scrollHeight, scrollTop, clientWidth } = e.target;
    this.scrollPosition = (scrollTop + clientWidth) / scrollHeight;
  }
}
Is that basically what mobx would be good for?
 
that would keep the scrollPosition up-to-date..
 
7:13 PM
Id use autorun
or computed
yeah probably not autorun
 
Don't do arrow functions as class methods... that's completely breaking prototypes...
 
@ndugger it's for binding
useful in react.
 
bind it like a normal person
 
bind it in the constructor
 
I do, but meh.. there are worse things.
 
7:15 PM
NO THERE AREN'T
 
it doesn't break prototypes, but it is a cheap hack for better binds
 
he's setting an observable, so there is no autorun or computed viable, yet.
it doesn't 'break' the prototype, it just doesn't use it.
 
yeah but that would be useful for updating whenever the scroll position updates or something?
 
@ndugger but isn't the way babel transpiles it essentially doing the same thing?
 
@corvid without knowing more about hwo you plan to use it.. I can't judge. It's an od example.
 
7:16 PM
components would just listen to it I imagine
 
@bitten if babel asked you to jump off of a bridge, would you do it?
 
and do things with the scroll position.
 
right.
 
it's a super simple straight forward example
 
what's a good generic example on a website? Like connecting to a websocket and keeping a set of data up to date?
 
7:17 PM
ohh, an item on my wishlist is on sale, you say, Steam?
 
@corvid you could use it for that
probably be a good idea to throttle the scroll at least
 
ohh, Rust. do I want rust, @Loktar?
 
@corvid input and server push are two big examples
 
@Luggage no
 
@ndugger if my present polyfilled in some great funeral music, maybe
 
7:17 PM
ok
 
@Loktar why? I've seen it come up a bunch of time and always heard it was meh, but never why.
 
Deleting from wishlist. Reason: Loktar said no.
 
"Server and input push" are just requests to the server?
 
@ssube generic survival game, they also are making major changes always
like they randomly decided to remove level based blueprints
 
i used to play Rust a lot and i would say yes if you have friends
 
7:18 PM
I am just now* playing Empyrion with some friends.
 
@bitten USED to is the key word
 
not bad.
 
most people did when it came out in EA
 
@corvid "server push" is requests from the server to the client, input is just input events
 
@Loktar yeah, i was playing this weekend actually too.. checking out the new component system
 
7:19 PM
and when they rewrote it I went back
 
i'd say it's an improvement
 
but idk overall it's just super meh imo, but just my opinion :p
 
well, i agree, apart from one point
which is when you get raided
 
oh, it's multiplayer only 3D survival, gross
 
@bitten ugh dude the raids...
 
7:19 PM
i've never felt so tense
 
well when you're there i guess
 
like my hands were shaking
 
Ah okay so input events make a lot of sense then
 
LOL
 
lol
 
7:20 PM
you ever play DayZ @bitten?
 
nope
should i?
 
ahh that was my first survival game with friends, I got the same way in that
 
@bitten no
 
awh cool
 
haha nah I would say no on that one too
it was super fun but now it seems pretty dead in the water
 
7:20 PM
DayZ is the flag bearer for games that died after EA
 
DayZ can get your heart racing.
 
these games it feels like you have to play them when they come out, when they have all the people
 
@Luggage yo
 
and also after the raid.. i just sat there for a bit. never felt so hollowed out by a game before
 
EA owns DayZ?
 
7:21 PM
it was a rollercoaster
 
@Luggage meant early access
 
@Luggage early access
 
oh
 
EA only kills games before release
 
@rlemon pong
 
7:21 PM
early access kills them after
 
@Loktar yeah exactly, i want to get overwatch on the weekend
 
@ssube whats dumb about DayZ is how they made so much money, and even a seperate team for it
 
I got that game
 
no reason for it to be in the state it's in
 
i was afraid i missed the hype but apparently not
 
7:21 PM
yeah I love overwatch @bitten
I play that almost every night lately
god dang that first name
 
@Loktar the underlying engine is pretty buggy.
and I like arma.
 
@Loktar yeah, it got really big for 5 minutes, but was a completely waste of everything
 
@Luggage yeah same, I 've been playing it since OFP
 
oh nice, i prefer console fps (i think i'm better with a controller) but if you want to play add me
 
@bitten lol hype
 
7:22 PM
@Luggage empyrion is okay by yourself.
I've never played with others.
 
It's better with friends.
 
I was really disappointed with Overwatch, especially compared to the other games that have been released this year.
 
it's my new Tean firtress 2
 
BF1 and Titanfall 2 were both much better
 
game I just go to when bored.
 
7:23 PM
but now that I have a capital ship, there isn't much challenge in the game.
 
@ssube haha well.. it was everywhere..
 
BF1 and TF2 died fast for me
 
@Loktar that's exactly my problem with it. It's like TF2. There are a bunch of classes and... they all feel the same.
There are a bunch of maps... nope, like 4.
 
steamcommunity.com/id/rlemon/games/?tab=all <- if anyone wants to get some games going. here's my list.
 
eh I'd have to disagree
 
7:23 PM
There are a bunch of things to do... nope, just run down the middle of the map.
 
in overwatch the classes feel a lot different
 
TF2 and Overwatch were both so incredibly shallow.
 
the nice thing about Overwatch is they are still adding classes
TF2 only changed weapons
 
the last two :(
 
I don't mind Sombra actually :p
 
7:24 PM
overwatch >> tf2 :D
 
the classes they've added are just weird, they don't fit into the game at all and step on the others
 
steamcommunity.com/id/luggage66/games/?tab=all but I lay offline a lot to hide, so the hours are low for a few games (KSP, Factorio)
 
sombra is cancer in ranked, but fun otherwise
 
@ThiefMaster damn!
 
@Loktar that allows for a lot of different playstyles.
 
7:25 PM
@ThiefMaster you have a shitload of hours in TF2 right?
 
I think part of my problem is that Overwatch (and TF2) are so carefully balanced for that pseudo-arcade-y "oh, this is kind of easy and fun" feel, which I can't stand.
Where as R6: Siege, BF1, Titanfall 2 are all like "oh, you're dead, fuck off"
 
@Luggage yes, and then compile it to WASM
 
@littlepootis yeah it does for sure, I mean I love TF2 but idk Overwatch has won me over recently
 
@Loktar i played it quite a bit in the past but not for some time now
 
@ndugger not that rust
 
7:26 PM
I only play good games, like runescape
 
if you can organise a good group of people @Luggage, or find a group to join, then i would try out Rust
 
I'm nearing 1500 hours in TF2..
 
I think we should all start playing Adventure Communist
 
owning a part of a map and owning territory is pretty crucial and close to impossible to do alone
@ssube loool
was there ever an room 17 minecraft server?
 
7:27 PM
~180h in OW
 
He looks upon me all day as I code
@ThiefMaster how do you check?
I probably have like... 30
 
career profile
 
@ThiefMaster gotten yourself one of those animated banners, yet?
 
I can't inline loader settings with JSON when doing a require() in Webpack? nooooooooo
 
hah yeah 29 hours
 
7:31 PM
@ssube animated spray decals you mean? no, i don't play ranked that much. the nice animated ones are only for the top500
 
one day I'd like to be that good at a game
 
git good git lmaobox
 
7:52 PM
Are there any git-based games yet? like rebase the progress of one saved game on another?
 
ugh
that could be a nintendo-hard game without much effort
 
@rlemon would just start the game over.
 
😞
 
that's what I tell people to do when they have broken repos
 
I tell them to filter-branch
 
7:55 PM
and @jAndy would just plain lose the game
 
what would the goal of the game be? To have a certain set of commits form a particular tree?
could we do some mechanic where the hashes matter?
 
There is the thing where you make your github contribution history into an image
 
Links or it didn't happen.
 
I was planning on doing that to my profile in gitlab before I leave
 
make it say "f you guys"
 
7:57 PM
@Luggage It's pretty popular, turns out there's an app for it: github.com/gelstudios/gitfiti
 
nice.
 
I <3 COMMUNISM
 

« first day (2243 days earlier)      last day (2699 days later) »