Ah


Ah! Just learned there is a name for this pattern. Ever created a file that just exports a bunch of things? That's a barrel.

A barrel is a way to rollup exports from several modules into a single convenient module. (Typically to make imports more convenient).

#javascript

Here's a great example of the "barrel pattern" in Angular, but of course applies to anyone using ES imports. http://tattoocoder.com/angular2-barrels/

View original on X