[Selection] Add ViewRegistry

This commit is contained in:
Victor Woeltjen 2016-09-21 12:29:43 -07:00
parent 7341ed9d03
commit 0a64e9f515

18
src/ui/ViewRegistry.js Normal file
View File

@ -0,0 +1,18 @@
define(['zepto'], function () {
function ViewRegistry() {
this.providers = [];
}
ViewRegistry.prototype.get = function (item) {
return this.providers.filter(function (provider) {
return provider.canView(item);
});
};
ViewRegistry.prototype.addProvider = function (provider) {
this.providers.push(provider);
};
return ViewRegistry;
});