Denzel

npm version Build Status Coverage Status Maintainability

Share Data Representations (Models, Collections) between Node and the Browser

Read the DOCS

Denzel

Installation

Denzel is available via npm for Nodejs, and bower for the Browser

Node

npm i -S denzel

Browser

You can require denzel from NPM with:

const {Model, Collection, Enum} = require('denzel/dist/denzel.min.js');

You can install denzel from bower with:

bower install denzel

Usage

Read the DOCS

Using in Redux

Classes as state really don't play too well with redux. SEE: Why Not to Store Objects In Redux

In ReactRedux/Vuex

  // inside a reducer
  switch(action.type) {
    case 'LOAD_USERS': {
      return new PersonCollection(action.users, User).toArray(); 
    }
    default: {
      return state
    }
  }