ro
@slickgrid-universal/rxjs-observable
npm i @slickgrid-universal/rxjs-observable
ro

@slickgrid-universal/rxjs-observable

Slickgrid-Universal is a monorepo which includes all Editors, Filters, Extensions, Services and is Framework Agnostic to take full advantage of SlickGrid core lib.

by Ghislain B.

2.3.0 (see all)License:MITTypeScript:Built-In
npm i @slickgrid-universal/rxjs-observable
Readme

License: MIT TypeScript lerna--lite npm npm

Actions Status Cypress.io jest codecov

RxJS Observable Service Wrapper

@slickgrid-universal/rxjs-observable

An RxJS Observable Service Wrapper to make it possible to use RxJS with Slickgrid-Universal (with a Backend Service like OData/GraphQL). By default any Backend Service will be using Promises unless we use this RxJS Observable package.

This package is simply a bridge, a facade, to make it possible to use RxJS without adding RxJS to the @slickgrid-universal/common list of dependencies, so RxJS is a dependency of this package without being a dependency of the common (core) package, This will avoid adding dependencies not everyone need and won't clutter the common package (the common package will simply use an empty interface, which won't do anything, without requiring to install RxJS at all. We also have full unit tests coverage for all of that).

Internal Dependencies

External Dependencies

Installation

Follow the instruction provided in the main README, you can see a demo by looking at the GitHub Demo page.

Usage

In order to use the Service, you will need to register it in your grid options via the registerExternalResources as shown below and of course install RxJS itself (this package requires RxJS 7).

ViewModel
import { GridOdataService } from '@slickgrid-universal/odata';
import { RxJsResource } from '@slickgrid-universal/rxjs-observable';

export class MyExample {
  gridOptions: GridOption;

  initializeGrid {
    this.gridOptions = {
      // you will most probably use it with a Backend Service, for example with OData or GraphQL
      backendServiceApi: {
        service: new GridOdataService(),
        preProcess: () => this.displaySpinner(true),
        postProcess: () => this.displaySpinner(false),

        // assuming your Http call is with an RxJS Observable
        process: (query) => this.getAllCustomers$(query),
      } as OdataServiceApi,

      // ...
      registerExternalResources: [new RxJsResource()],
    };
  }
}
VersionTagPublished
2.3.0
latest
6d ago
2.0.0-alpha.0
next
3mos ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate