Skip to content

Commit

Permalink
added pullstate
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronGibson2 committed Apr 18, 2024
1 parent 5091f05 commit 80e4019
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client/src/services/SettingsStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Store } from "pullstate";

interface SettingsInterface {

Check warning on line 3 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Delete `·`
isDarkMode: boolean;
};

Check warning on line 5 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Delete `;`

export const SettingStore = new Store<SettingsInterface>({
isDarkMode: false,

Check warning on line 8 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Delete `··`
});

export const toggleTheme = async() => {

Check warning on line 11 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Insert `·`
SettingStore.update((store) => {

Check warning on line 12 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Delete `··`
store.isDarkMode = !store.isDarkMode;

Check warning on line 13 in client/src/services/SettingsStore.ts

View workflow job for this annotation

GitHub Actions / lint (21.x)

Replace `····store.isDarkMode·=·!store.isDarkMode;·` with `store.isDarkMode·=·!store.isDarkMode;`
});
};

0 comments on commit 80e4019

Please sign in to comment.