Echo JS 0.11.0

<~>

tracker1 comments

tracker1 3518 days ago. link 2 points
I'm pretty sure my car does have over 291 parts... Not all of them moving parts, or directly related to the drivetrain.. but if you include the components for computer control, fuel injection, systems monitoring, breaking, stearing, etc, I'd be surprised if there weren't more than 291 parts there alone.

I understand the concern... also of concern is when you see multiple versions of lodash, underscore and ramda (I know the last one is different, but similar usage).  It's as bad as a few years ago, you open up the home page for the companies website and discover 3+ versions of jQuery being loaded.

Of course, beyond all of that, I'd rather have hundreds of small modules doing one thing well and easily replaced than any given monolith.
tracker1 3526 days ago. link 3 points
WTF!?!?  Article submission, to summary page on medium that links to the article...

That said, this is part of what I don't like wrt angularisms..

    expiry: ['', [Validators.required, Validators.pattern(expiryRegex)]]

Why does it even need nested arrays, the first item is the current value, just have the rest be validation..  Or better uet, have it be an object, that you pass an array of validators to.

    expiry: validatedValue({
      value: '',
      validation: [
        Validators.required, 
        Validators.pattern(expiryRegex)
      ]
    })

I know I could make that function... I just mean that ng2 chose TypeScript so that they could have enforced structure and types, then they use this weird array structured dsl in places.
tracker1 3526 days ago. link 3 points
Really wish it didn't cost karma to vote down... it's hard to earn it on this site.
tracker1 3527 days ago. link 1 point
flatmap is just map + reduce

    invoices
      .map(inv => inv.positions)
      .reduce((a, p) => a.concat(p || []), []);

ex:

    function flatmap(object, mapper) {
      return object.map(mapper)
        .reduce((agg, ary) => agg.concat(ary || []), [])
    }
tracker1 3527 days ago. link 1 point
For me, read everything you can, try to remember the bullet points, and later on, when you have a chance or use case, give it a try.

Some things take more buy in... React can be brought into a project in pieces... but after a while, you're best off with other tooling in addition, Babel and a bundler become nearly indispensable (it took me a while to warm to Webpack over Browserify though).
tracker1 3527 days ago. link 1 point
It's not *really* stateless, it's just the state is served via properties on the component.
tracker1 3527 days ago. link 1 point
I was just arguing with a coworker a few days ago that "async" functions were imminent, and since we're using babel anyway that we should go ahead and use them.
[more]