Echo JS 0.11.0

<~>

xat comments

xat 51 days ago. link 4 points
nice :) but you really should add some tests.
xat 71 days ago. link 2 points
Sounds like an interesting pattern in general and I would love to hear the opinion from somebody who used this already in some bigger projects.

Although I am a bit afraid that this results in some deep nested component structure. For example, say you have a Page component, inside that a Sidebar component, inside that a Navigation component, inside that a List component, inside that Item-Group components and inside that you have the actual Item components. This would already be like 5 levels of nesting. Now add Routing components etc. to the mix...
xat 78 days ago. link 5 points
A nice use case for portals (other than modals, dropdowns etc.) could be dynamic widgets on websites (like the typical wordpress / drupal websites). For example, if you have dynamic widgets which are spread across the page, but somehow belong together. So you could have a widget for the search-field in the header of the page and a widget for the search-results in the content area and both would be part of the same react app. Or a table with filters, where the table and the filters are two separate widgets.
xat 103 days ago. link 1 point
Agreed. I mostly keep the state in some container components and only use redux if it's really needed. That approach works just fine.
xat 111 days ago. link 1 point
Interesting that this article got upvoted like hell on Reddit, but only gets downvotes here :)

Any reason for that?

IMHO it is a solid list. If you know all the topics mentioned, you are probably able to pickup any framework quite fast and have a good understanding about how JS works.
xat 112 days ago. link 2 points
Not sure if this was made 100% clear in the article (although it's mentioned), but instead of an IIFE you can also use 'let' in the last example:

for (let i = 0; i < 5; i++) {
  setTimeout(function () {
    console.log('index: ' + i);
  }, 1000);
}
xat 134 days ago. link 1 point
Yeah, I intentionally did the example with a number, because there you have the problem of 0 being falsy.
The `??`-solution would be nice IMHO.
xat 134 days ago. link 1 point
Cool proposal in general, although there are still cases where _.get is somehow nicer:

const num = _.get(foo, 'bar.baz', 1337);

VS:

const num = typeof foo?.bar?.baz !== 'undefined' ? foo?.bar?.baz : 1337;
[more]