33 lines
660 B
JavaScript
33 lines
660 B
JavaScript
import Chart from "../core.js";
|
|
import { name, schema } from "./entities/test.js";
|
|
/**
|
|
* For testing
|
|
*/ export default class TestChart extends Chart {
|
|
total = 0;
|
|
constructor(){
|
|
super(name, schema);
|
|
}
|
|
async tickMajor() {
|
|
return {
|
|
"foo.total": this.total
|
|
};
|
|
}
|
|
async tickMinor() {
|
|
return {};
|
|
}
|
|
async increment() {
|
|
this.total++;
|
|
await this.commit({
|
|
"foo.total": 1,
|
|
"foo.inc": 1
|
|
});
|
|
}
|
|
async decrement() {
|
|
this.total--;
|
|
await this.commit({
|
|
"foo.total": -1,
|
|
"foo.dec": 1
|
|
});
|
|
}
|
|
}
|