Echo JS 0.11.0

<~>

tracker1 comments

tracker1 3297 days ago. link 2 points
No mention of reduce...

    Object.keys(obj)
      .map(k => foo(k, obj[k]))
      .reduce((a, b) => Object.assign(a, b), {});

that's one of my favorites... break up an object/hash map, do something to each, and reconstruct hash map... assuming `foo(k, v)` returns `{ [k]: bar(v) }`;

map is cool and powerful, but so is reduce.
tracker1 3297 days ago. link 1 point
I know... I work with Windows, Linux and Mac on a daily basis.  I was just pointing it out in context as to why that was chosen.  It *could* also be thought of as the *home* for the application itself.

I even mentioned that node specifically doesn't do anything with tilde in the fs or path modules, even in a unixy environment.
tracker1 3297 days ago. link 1 point
I'm relatively sure the author has exposure to .Net as the tilde is used as project root the too.  It doesn't work out autosub for profile/home in node currently in any of the path or FS modules.
tracker1 3300 days ago. link 2 points
Really looking forward to seeing uWS's http implementation come forward sooner than later.
tracker1 3304 days ago. link 1 point
The comparison is very shallow, and inconclusive even to itself.
tracker1 3306 days ago. link 1 point
TFA's example doesn't work for server-side fetching, and kind of dismisses the issue... the reality is that one should use methods that work for both, if you're going to have universal rendering, so you don't have weird complicated code to do the same thing in two places.
tracker1 3307 days ago. link 1 point
Two things I always try to enforce in code reviews are the use of map/reduce instead of for-loops when practical, and returning early from functions...

    // instead of
    fn() {
      if (foo) {
        //really long code block
      } else {
        //really short code block
      }
    }

    // this
    fn() {
      if (!foo) {
        // really short code block
        return ...;
      }

      // less nested code case
    }

It tends to happen a lot, and the function becomes much more clear when you can get out of it asap instead of deep nested blocks.
tracker1 3308 days ago. link 1 point
Interesting, though would be nice if it were a keyboard character used... it always irks me when frameworks choose an obscure character for things like this.
tracker1 3314 days ago. link 1 point
Glad to see extensible end points for webpack, babel (pending) will also be pretty nice.  It's a minor niggle, because there are an ever decreasing number of features outside stage-3 that I'm using.
tracker1 3320 days ago. link 1 point
This is really not JS related... I mean even CSS stuff is borderline tangential, but this is an entire other language.
[more]