mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-02 07:07:46 -04:00
drop ClayEvents.one since it is a pain to work with and add tests for ClayEvents
This commit is contained in:
@@ -193,7 +193,18 @@ ClayConfig.registerComponent = function(component) {
|
||||
var _component = _.copyObj(component);
|
||||
if (typeof _component.manipulator === 'string') {
|
||||
_component.manipulator = manipulators[component.manipulator];
|
||||
|
||||
if (!_component.manipulator) {
|
||||
throw new Error('The manipulator: ' + component.manipulator +
|
||||
' does not exist in the built-in manipulators.');
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof _component.manipulator.set !== 'function' ||
|
||||
typeof _component.manipulator.get !== 'function') {
|
||||
throw new Error('The manipulator must have both a `get` and `set` method');
|
||||
}
|
||||
|
||||
componentStore[_component.name] = _component;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user