2.4.1 • Published 1 year ago

@holaluz/pomada v2.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Pomada

A shared FE business logic repository.

Quick start

Install the library:

npm i @holaluz/pomada

Import and execute the use case you need. For example, getting prices of the products of a supply point:

import { getProductPrices, getSupplyPoint } from '@holaluz/pomada'

getSupplyPoint(
  {
    cups: 'example cups',
  },
  {
    onSuccess(supplyPoint) {
      getProductPrices(
        {
          products: supplyPoint.contractableProducts,
          consumption: supplyPoint.consumption,
          currentPower: supplyPoint.currentPower,
          desiredPower: supplyPoint.optimizedPower,
          optimizedPower: supplyPoint.optimizedPower,
        },
        {
          onSuccess(prices) {
            console.log(prices)
          },
          onError(error) {
            console.log(error)
          },
        }
      )
    },
    onCupsAlreadyClient(supplyPoint) {
      console.log(supplyPoint)
    },
    onCupsInvalid(cupsError) {
      console.log(cupsError)
    },
  }
)

For a more in-depth documentation, check the docs.

Usage for staging or production

This library reads a process.env.ENV variable, and access staging APIs if ENV = staging or production APIs if ENV = production.

Development

Use Visual Studio Code. Execute and debug code with its included Typescript debugger (pressing F5).

Documentation is generated automatically for every use case and models inside src. Check out Typedoc for the available options.

Links

Documentation.

Npm Package.

Repository.

2.4.1

1 year ago

2.4.0

1 year ago

2.3.0

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.1.0

2 years ago

2.0.0

2 years ago

1.8.0

2 years ago

1.6.2

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.3.0-beta.1

3 years ago

1.2.0

3 years ago

1.3.0-beta.2

3 years ago

1.1.1

3 years ago

1.1.1-beta.2

3 years ago

1.1.1-beta.1

3 years ago

1.1.0-beta.2

3 years ago

1.1.0

3 years ago

1.1.0-beta.1

3 years ago

1.0.3

3 years ago