https://github.com/zakimohammed/ng-cashew-app
🥜 NgCashew app to explore the air light @ngneat/cashew package to cache Angular HTTP requests powered by Cirrus UI.
https://github.com/zakimohammed/ng-cashew-app
angular cache cashew cirrus-ui http ngneat
Last synced: about 2 months ago
JSON representation
🥜 NgCashew app to explore the air light @ngneat/cashew package to cache Angular HTTP requests powered by Cirrus UI.
- Host: GitHub
- URL: https://github.com/zakimohammed/ng-cashew-app
- Owner: ZakiMohammed
- Created: 2023-05-22T21:13:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T14:40:33.000Z (about 3 years ago)
- Last Synced: 2025-10-04T21:52:17.935Z (9 months ago)
- Topics: angular, cache, cashew, cirrus-ui, http, ngneat
- Language: TypeScript
- Homepage: https://ng-cashew-app.netlify.app/
- Size: 171 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🥜 NgCashew
Check out the CodeOmelet blog post for this project.
Link: https://codeomelet.com/posts/cache-angular-http-request-using-ngneat-cashew
___
NgCashew app to explore the air light `@ngneat/cashew` package to cache Angular HTTP requests powered by Cirrus UI.
## Run Project
```
npm start
```
## Add Cashew Package
```
npm i @ngneat/cashew
```
## Add to App Modules
```
@NgModule({
imports: [
HttpClientModule,
HttpCacheInterceptorModule.forRoot(),
...
],
})
```
## Add to HTTP Service
Configure the options object:
```
private options = {
context: withCache()
};
```
Pass it to `get` method:
```
getUsers() {
const url = `${this.url}${this.userUrl}`;
return this.http.get(url, this.options);
}
```