aboutsummaryrefslogtreecommitdiff
path: root/src/content/repositories/FollowSlaveRepository.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-19 09:26:52 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-19 09:26:52 +0900
commite0c4182f14f908d13c8c814c7bc2b48a1791f881 (patch)
treea277179d51013c4a2384f076197a1dbcc442d2d0 /src/content/repositories/FollowSlaveRepository.ts
parent5b7f7f5dbd94b5bce7aee4667add187ffb9944f2 (diff)
Follow as a clean architecture
Diffstat (limited to 'src/content/repositories/FollowSlaveRepository.ts')
-rw-r--r--src/content/repositories/FollowSlaveRepository.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/content/repositories/FollowSlaveRepository.ts b/src/content/repositories/FollowSlaveRepository.ts
new file mode 100644
index 0000000..4c2de72
--- /dev/null
+++ b/src/content/repositories/FollowSlaveRepository.ts
@@ -0,0 +1,31 @@
+export default interface FollowSlaveRepository {
+ enableFollowMode(): void;
+
+ disableFollowMode(): void;
+
+ isFollowMode(): boolean;
+
+ // eslint-disable-next-line semi
+}
+
+const current: {
+ enabled: boolean;
+} = {
+ enabled: false,
+};
+
+export class FollowSlaveRepositoryImpl implements FollowSlaveRepository {
+ enableFollowMode(): void {
+ current.enabled = true;
+ }
+
+ disableFollowMode(): void {
+ current.enabled = false;
+ }
+
+ isFollowMode(): boolean {
+ return current.enabled;
+ }
+}
+
+