node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

netiam-contrib-state

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({
    userModel: User,
    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