mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-24 01:04:16 +02:00
feat: introduce intersection calculation of charts
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import autobind from 'autobind-decorator';
|
||||
import Chart, { KVs } from '../core';
|
||||
import { name, schema } from './entities/test-intersection';
|
||||
|
||||
/**
|
||||
* For testing
|
||||
*/
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default class TestIntersectionChart extends Chart<typeof schema> {
|
||||
constructor() {
|
||||
super(name, schema);
|
||||
}
|
||||
|
||||
@autobind
|
||||
protected async queryCurrentState(): Promise<Partial<KVs<typeof schema>>> {
|
||||
return {};
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async addA(key: string): Promise<void> {
|
||||
await this.commit({
|
||||
a: [key],
|
||||
});
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async addB(key: string): Promise<void> {
|
||||
await this.commit({
|
||||
b: [key],
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user