https://github.com/lb1997ccb/ng-ngrx-rest-example
This Angular 17 project showcases the integration of NgRx for state management and caching of API data. It connects to the Solar System OpenData API to fetch information about planets and uses NgRx to manage the state of the retrieved data.
https://github.com/lb1997ccb/ng-ngrx-rest-example
angular ngrx-effects ngrx-example ngrx-store
Last synced: 3 months ago
JSON representation
This Angular 17 project showcases the integration of NgRx for state management and caching of API data. It connects to the Solar System OpenData API to fetch information about planets and uses NgRx to manage the state of the retrieved data.
- Host: GitHub
- URL: https://github.com/lb1997ccb/ng-ngrx-rest-example
- Owner: lb1997ccb
- License: mit
- Created: 2024-06-17T11:57:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-26T10:18:31.000Z (about 1 year ago)
- Last Synced: 2025-02-07T19:16:44.756Z (5 months ago)
- Topics: angular, ngrx-effects, ngrx-example, ngrx-store
- Language: TypeScript
- Homepage:
- Size: 166 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Planets App
This project demonstrates the use of Angular with NgRx for managing state, specifically for fetching and displaying data from an external API.
## Functionality
### Planet Service (`PlanetService`)
The `PlanetService` retrieves data about planets from an external API using Angular's `HttpClient`.
### NgRx Effects (`PlanetEffects`)
`PlanetEffects` implements NgRx effects to handle asynchronous actions related to planets, such as loading and error handling.
### NgRx Selectors
- `selectAllPlanets`: Selects the array of planets from the NgRx store.
- `selectPlanetsLoading`: Selects the loading state indicating whether planets are being fetched.
- `selectPlanetsError`: Selects any error that occurs while fetching planets.## Installation
1. Clone this repository.
2. Install dependencies using `npm install`.
3. Run the application using `ng serve`.## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.