A feature is a method that can be applied to an object and will provide some kind of generic functionality.
All features should conform to the following interface:
const ExampleFeature = function(config, host) {
return ExampleFeatureInterface || undefined;
}
- a feature is always a function
- the name of the feature is always written in pascal-case and ends with the word
Feature
- a feature usually takes two arguments, first a configuration value and second the object that hosts the feature. If no configuration value is needed, the only argument is the host.
- if a feature doesn't require a host argument, it's not a feature
- a feature can either return an object that implements its interface or
undefined