@appolo/cache
Version:
appolo cache module
103 lines (70 loc) • 1.63 kB
text/typescript
import {define, singleton} from '@appolo/inject'
import {Promises} from '@appolo/utils'
import {cache} from "../../index";
export class Handler {
public test: number = 0;
handle() {
return ++this.test;
}
async handle2() {
return ++this.test;
}
async handle3(name: string) {
++this.test;
return name + this.test;
}
async handle4() {
return ++this.test;
}
async handle5() {
return ++this.test;
}
async handle6(name: string) {
++this.test;
return this.test + name;
}
async handler7(id: number) {
await Promises.delay(10);
++this.test;
return this.test
}
public async handle8(id: number) {
await Promises.delay(10);
this.counter++;
return null
}
public async handle9(id: number) {
await Promises.delay(10);
this.counter++;
return null
}
public counter = 0;
}
export class BaseHandler {
public test = 0;
handle() {
return ++this.test;
}
}
export class InheritHandler1 extends BaseHandler {
}
export class InheritHandler2 extends BaseHandler {
}