Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

netiam/contrib-state

Repository files navigation

netiam-contrib-state

Build Status Dependencies npm version

A state plugin for netiam

Get it

npm i -S netiam netiam-contrib-state

Example

netiam({plugins})
  .rest({model: User})
  .state.res({
    map: [
      {
        base: Component,
        state: UserComponent,
        baseField: 'componentId',
        userField: 'owner'
      },
      {
        base: Campaign,
        state: UserCampaign,
        baseField: 'campaignId',
        userField: 'owner'
      },
      {
        base: Node,
        state: UserNode,
        baseField: 'nodeId',
        userField: 'owner'
      }
    ]
  })
  .json()

License

MIT License