Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor caching and debugging modules #4

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,26 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 22.x ]
node-version: [22.x]

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm ng-rebrickable:build
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
build
coverage
dist
pnpm-lock.yaml
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,30 @@ Use your favourite package manager to install in your project
```typescript
import { provideRebrickable } from "ng-rebrickable";
import { AppComponent } from "./app.component";
import { withDebugging } from "ng-rebrickable/features/debugging";

bootstrapApplication(AppComponent, {
providers: [
provideRebrickable({
apiKey: "your-rebrickable-api-key", // mandatory
debug: true, // optional (need to change console level to verbose)
})
]
})
provideRebrickable("your-rebrickable-api-key", /* Optional */ withDebugging()),
],
});
```

- There are 2 optional caching methods
- `withLocalStorageCache()` - cache will be handled with localStorage
- `withIndexedDBCache()` - cache will be handled with IndexedDB

```typescript
import { provideRebrickable } from "ng-rebrickable";
import { AppComponent } from "./app.component";
import { withLocalStorageCache } from "ng-rebrickable/features/localstorage";

bootstrapApplication(AppComponent, {
providers: [
provideRebrickable("your-rebrickable-api-key", withLocalStorageCache()),
],
});

- Use service anywhere in your app

```typescript
Expand Down
9 changes: 2 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,8 @@
"index": "projects/ng-rebrickable-demo/src/index.html",
"tsConfig": "projects/ng-rebrickable-demo/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"projects/ng-rebrickable-demo/src/favicon.ico",
"projects/ng-rebrickable-demo/src/assets"
],
"styles": [
"projects/ng-rebrickable-demo/src/styles.scss"
],
"assets": ["projects/ng-rebrickable-demo/src/favicon.ico", "projects/ng-rebrickable-demo/src/assets"],
"styles": ["projects/ng-rebrickable-demo/src/styles.scss"],
"scripts": [],
"browser": "projects/ng-rebrickable-demo/src/main.ts"
},
Expand Down
Loading
Loading