drop ClayEvents.one since it is a pain to work with and add tests for ClayEvents

This commit is contained in:
Keegan
2016-02-09 17:19:41 -08:00
parent 80982c8e6d
commit c0f6fb770c
6 changed files with 265 additions and 39 deletions
+11
View File
@@ -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;
};