import autobind from 'autobind-decorator'; import Chart, { KVs } from '../core'; import { name, schema } from './entities/test'; /** * For testing */ // eslint-disable-next-line import/no-default-export export default class TestChart extends Chart { public total = 0; // publicにするのはテストのため constructor() { super(name, schema); } @autobind protected async tickMajor(): Promise>> { return { 'foo.total': this.total, }; } @autobind protected async tickMinor(): Promise>> { return {}; } @autobind public async increment(): Promise { this.total++; await this.commit({ 'foo.total': 1, 'foo.inc': 1, }); } @autobind public async decrement(): Promise { this.total--; await this.commit({ 'foo.total': -1, 'foo.dec': 1, }); } }