Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!
Paste
Pasted as JavaScript by x ( 7 years ago )
export default class FooService {
static instance;
constructor() {
if (instance) {
return instance;
}
this.instance = this;
}
loadFoo() {
return fetch();
}
getFoo(forceReload) {
if (this.foo && !forceReload) {
return Promise.resolve(this.foo);
}
return this.loadFoo()
.then(foo => this.foo = foo)
.then(() => this.foo);
}
}
Revise this Paste