blob: afa980ace839d142bc1ad1c4ae7e908f62d16793 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import Mark from '../domains/Mark';
export default interface MarkRepository {
set(key: string, mark: Mark): void;
get(key: string): Mark | null;
}
const saved: {[key: string]: Mark} = {};
export class MarkRepositoryImpl implements MarkRepository {
set(key: string, mark: Mark): void {
saved[key] = mark;
}
get(key: string): Mark | null {
const v = saved[key];
if (!v) {
return null;
}
return { ...v };
}
}
|