[REF] owl: reorganize exports, remove registry, remove web example

closes #38
This commit is contained in:
Géry Debongnie
2019-04-16 17:15:05 +02:00
parent eac49562fa
commit a22dcdaddf
1642 changed files with 8 additions and 123831 deletions
-1
View File
@@ -1,7 +1,6 @@
export { Component, PureComponent } from "./component";
export { EventBus } from "./event_bus";
export { QWeb } from "./qweb";
export { Registry } from "./registry";
export { connect, Store } from "./store";
import * as _utils from "./utils";
-28
View File
@@ -1,28 +0,0 @@
/**
* The registry is basically a simple hashmap. It is only a little safer and
* more structured than a simple object.
*/
export class Registry<T> {
private map: { [key: string]: T } = {};
/**
* Add an element to the registry. Note that the add method returns the
* registry, to it can be chained.
*/
add(key: string, item: T): Registry<T> {
if (key in this.map) {
throw new Error(`Key ${key} already exists!`);
}
this.map[key] = item;
return this;
}
/**
* Returns the element corresponding to the key
*
* Nothing is done to check that the key actually exists.
*/
get(key: string): T | undefined {
return this.map[key];
}
}