How to use the @ngrx/schematics/schematics-core.addReducerImportToNgModule function in @ngrx/schematics

To help you get started, we’ve selected a few @ngrx/schematics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngrx / platform / modules / schematics / src / reducer / index.ts View on Github external
? noop()
        : filter(path => !path.endsWith('.spec.ts.template')),
      applyTemplates(templateOptions),
      move(parsedPath.path),
    ]);

    const templateSource = apply(
      url(options.creators ? './creator-files' : './files'),
      [applyTemplates(templateOptions), move(parsedPath.path)]
    );

    return chain([
      branchAndMerge(chain([addReducerToState(options)])),
      branchAndMerge(
        chain([
          addReducerImportToNgModule(options),
          mergeWith(commonTemplate),
          mergeWith(templateSource),
        ])
      ),
    ])(host, context);
  };
}