Skip to content

A simple example of using ngrx for caching lookup data and maintaining a simple array of items. This includes add, remove, update and clear.

Notifications You must be signed in to change notification settings

bonejon/ngrx-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NgrxSample Application

build status

This project was generated with Angular CLI version 7.1.4.

The purpose of this project is to demonstrate a clean PoC application using angular and ngrx for state management. There are two styles of state management in use. Within the CommonState application metadata is cached by using the withLatestFrom pipe to determine whether the metadata exists within the state if not then a service is called to load the data and the reducer will update the state.

The CartState uses a more traditional application flow to add, update, remove, and clear a shopping cart that could be submitted to the server on user request.

Both states have full tests round the actions, effects, and reducers to ensure correctness and functionality.

Installing dependencies

The project dependencies are managed by yarn, so ensure you have the latest version installed and run yarn in the root directory.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

For a full pipeline build including linting and testing run npm run build. This will build the output to the dist/ directory with full AOT and treeshaking.

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Further help

Log a github issue within the repository NgrxSample Application GitHub

About

A simple example of using ngrx for caching lookup data and maintaining a simple array of items. This includes add, remove, update and clear.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published