DEV Community

Generating Angular Container Components, the Fast and Easy Way

Stephen Chiang on December 18, 2018

Some of you might be familiar with the concept of container components. If not, they are components meant to 'wrap' around your presentation compon...
Collapse
 
rierjarv profile image
Riku Järvinen

Great article thanks, I'll Be looking into using container components from now on. By the way, you can probably use store.select directly, thus making pipe unnecessary?

Collapse
 
chiangs profile image
Stephen Chiang • Edited

Hi thanks! You can indeed go directly with store.select, but the benefit of piping in custom selectors and using the createSelector from NgRx Store is that you get memoized selectors.

Memoized selectors cache the data and provide efficient re-rendering if needed, because a call doesn't have to be made all the way back to the resource if the data hasn't changed and another component needs it.

Collapse
 
rierjarv profile image
Riku Järvinen

Ok, good to know :) thanks!

Collapse
 
layzee profile image
Lars Gyrup Brink Nielsen

I only now discovered your article, Stephen. Thanks for mentioning my work and for helping me write it 😊 Great article. To the point.