0.3.3 • Published 6 years ago

junction-normalizr-decorator v0.3.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Junction Normalizr Decorator

Build Status Code Coverage

Map your Junction entity schema to an output suitable for normalizr

Install

npm install junction-normalizr-decorator --save

Usage

Decorate your schema-defined entities with @normalizable([options]) and access the normalizr schema via the normalizedSchema getter. The options parameter, if provided, is passed as the second argument to the normalizr schema.

@normalizable()
class Car {

  wheels = 4;
  electric = true;

}

Car.schema = {
  type: 'entity',
  props: {
    wheels: {
      type: 'number',
      isRequired: true
    },
    electric: {
      type: 'boolean',
      isRequired: true
    }
  }
}

const response = normalize(fetchCars(), Car.normalizedSchema);

Licence

MIT

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago