JSPM

  • Created
  • Published
  • Downloads 63
  • Score
    100M100P100Q50101F
  • License BSD-3-Clause

Package Exports

  • ig-features

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ig-features) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Features

Features is a module that helps build features out of sets of actions apply them to objects and manage sets of features via external criteria and feature-to-feature dependencies.

The main entities:

FeatureSet (Features)

var feature_set = new FeatureSet()


// define features...
// ...


// setup features...
feature_set
  .setup([
    'feature-tag',
    //...
  ])

XXX

Feature

feature_set.Feature({
  tag: 'minimal_feature_example',
})

feature_set.Feature({
  // documentation (optional)...
  title: 'Example Feature',
  doc: 'A feature to demo the base API...',

  // feature unique identifier (required)...
  tag: 'feature_example',

  // applicability test (optional)
  isApplicable: function(){ /* ... */ },

  // feature load priority (optional)
  priority: 'medium',

  // list of feature tags to load if available (optional)
  suggested: [],

  // list of feature tags required to load before this feature (optional)
  depends: [],

  // Exclusive tag (optional)
  exclusive: 'Example feature',

  // feature configuration (optional)
  config: {
    option: 'value',
    // ...
  },

  // actions (optional)
  actions: Actions({
    // ...
  })

  // action handlers (optional)
  handlers: [
    ['action.pre', function(){ /* ... */ }],
    // ...
  ] 
})

XXX

Meta-features

// meta-feature...
feature_set.Feature('meta-feature-tag', [
  'suggested-feature-tag',
  'other-suggested-feature-tag',
  // ...
])

XXX