Daniel Lo Nigro 0076204f80 Fix Flow.
Removed `@flow` annotation from files that don't actually pass Flow check at the moment. These will be added back file by file once the files are properly converted to use Flow.

Closes #3064
2015-11-15 21:30:22 -08:00

25 lines
467 B
JavaScript

export default class Store extends Map {
constructor() {
super();
this.dynamicData = {};
}
dynamicData: Object;
setDynamic(key, fn) {
this.dynamicData[key] = fn;
}
get(key: string): any {
if (this.has(key)) {
return super.get(key);
} else {
if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
let val = this.dynamicData[key]();
this.set(key, val);
return val;
}
}
}
}