3.3.0 • Published 7 years ago

pie-controller v3.3.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

pie-controller

A controller for a pie player.

It calls the underlying element-specific controller based on the id and pie.name in the data model.

usage

  
  import PieController from 'pie-controller';
  
  var controllerMap = {
    'pie-element' : pieElementController
  };

  var model = {
    pies: [
      { 
        id: '1', 
        element: 'pie-element'
      }
    ],
    langs: ['en-US'],
    weights: [{id: '1', weight: '1'}]
  }

  var controller = new PieController(model, controllerMap);
	
  /**
   * @param ids - an array of ids
   * @param sessions - an array of session data
   * @param env - the env 
   */
  controller.model(['1'], [{id: '1', ...}], {})
    .then((results) => {
      console.log(results);
    });

Browser Integration

This package exports an es6 module, if you want to use it in the browser you'll have to include it in a build tool like webpack and babel.

Test

npm test 

Release

npm run release
3.3.0

7 years ago

3.2.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago