example-app icon indicating copy to clipboard operation
example-app copied to clipboard

Show an example of code splitting

Open SethDavenport opened this issue 8 years ago • 2 comments

The code is already organized into a lions module and an elephants module. In a larger app, we'd want to code split these such that needed code is only loaded when the relevant app route is activated. Redux introduces some challenges here but they're not insurmountable. How can we:

  • only load the elephants components, actions, and epics when the elephants route is accessed?
  • same thing for the lions stuff?
  • same thing for the feedback stuff?

Ideally we webpack would output code chunks for these routes and load them on the fly.

SethDavenport avatar Feb 22 '17 03:02 SethDavenport

'Factal' state management for code splitting/lazy loaded modules is planned for the next release of ngrx as well. (https://github.com/ngrx/store/issues/379)

murraybauer avatar Apr 15 '17 13:04 murraybauer

We've released fractal state management in 6.4.0. Details here: https://github.com/angular-redux/store/blob/master/articles/fractal-store.md

SethDavenport avatar May 26 '17 05:05 SethDavenport