0.3.0 • Published 2 months ago

@jifeline/customer-shared v0.3.0

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Customer Shared library

The Customer Shared library contains shared functionality and type definitions within the Jifeline Customer domain. These functionalities and types are used by different Customer libraries that are not specific for one of these libraries, hence they are shared.

The Customer Shared library provides modules for:

  • Countries
  • Currencies
  • Discount
  • Prices
  • Utils

Usage of the library

In order to use these libraries, simply import it with ES6 import statements. The namespace is @jifeline, so the full import path would be; @jifeline/customer-shared.

import { countries, currencies, utils } from '@jifeline/customer-shared';

countries
  .getCountries$()
  .pipe(take(1))
  .subscribe(countries => console.log(countries));

currencies
  .getCurrencies$()
  .pipe(take(1))
  .subscribe(currencies => console.log(currencies));

utils
  .getCoords()
  .subscribe(coords => console.log(coords));

Modules

The Customer Shared library provides the following modules:

  • countries
  • currencies
  • discount
  • price
  • utils

Countries

The countries module provides the following features:

  • countries

The following functions are supported:

  • get countries$

Currencies

The currencies module provides the following features:

  • currencies

The following functions are supported:

  • get currencies$

Discount

The discount module only provides type definitions regarding discounts.

Price

The price module only provides type definitions regarding prices.

Utils

The utils module provides the following features:

  • battery
  • geolocation
  • group by
  • timer

Battery

The battery feature returns the battery state of the system the current user is working on. This is based on navigator.getBattery feature.

The following functions are supported:

  • get battery level

Geolocation

The geolocation feature returns the coords of the system the current user is working on, based on their IP address, using the location navigator.geolocation feature.

The following functions are supported:

  • get coords

Group by

The group by feature allows grouping of collections. These grouping of collections is used by Jifeline in order to group collections like Vehicle Makes, or Ticket History, or merge collections based on key of an item within a collection.

The following functions are supported:

  • group by first char of key
  • group by date
  • merge grouped by collections

Timer

The timer feature can create timers based on dates. The timer will count down to the given date in the feature and complete when the timer is finished.

The following functions are supported:

  • get timer$
  • is timer finished
  • get timer