3.0.1 • Published 8 months ago

ng-rebrickable v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

NgRebrickable

NgRebrickable is a TypeScript library to use Rebrickable API for Angular

Installation

Use your favourite package manager to install in your project

 npm install ng-rebrickable
 yarn add ng-rebrickable
 pnpm add ng-rebrickable

Usage

  • Provide into your application
import { provideRebrickable } from "ng-rebrickable";
import { AppComponent } from "./app.component";
import { withDebugging } from "ng-rebrickable/features/debugging";

bootstrapApplication(AppComponent, {
  providers: [
    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
    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

import {Component} from '@angular/core';

@Component({...})
export class AppComponent {

  constructor(private readonly rebrickableService: RebrickableService) {
  }

  colors$ = this.rebrickableService.colors({
    page: 1,
    page_size: 10,
    ordering: [
      { type: 'DESC', fields: 'field-1' },
      { type: 'ASC', fields: 'field-2' },
    ]
  });
}
3.0.1

8 months ago

3.0.0

10 months ago

2.1.0

10 months ago

2.0.0

11 months ago

1.0.0

2 years ago

0.0.1-alpha

2 years ago