aboutsummaryrefslogtreecommitdiff
path: root/src/content/repositories/FollowKeyRepository.ts
blob: a671b5c857a6268ff8b3d6ccee64a157290de3c0 (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
24
25
26
27
28
29
30
31
32
33
34
35
export default interface FollowKeyRepository {
  getKeys(): string[];

  pushKey(key: string): void;

  popKey(): void;

  clearKeys(): void;

  // eslint-disable-next-line semi
}

const current: {
  keys: string[];
} = {
  keys: [],
};

export class FollowKeyRepositoryImpl implements FollowKeyRepository {
  getKeys(): string[] {
    return current.keys;
  }

  pushKey(key: string): void {
    current.keys.push(key);
  }

  popKey(): void {
    current.keys.pop();
  }

  clearKeys(): void {
    current.keys = [];
  }
}