-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop generateGetters higher order function support
While this HoF does work and autowires our state as intended, it is unable to pass typescript compilation checks because typescript expects the methods to be defined explicitly instead of being generated at runtime. Signed-off-by: Jeremy Ho <jujaga@gmail.com>
- Loading branch information
Showing
3 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
import { computed, unref } from 'vue'; | ||
|
||
import type { IGetterIndex, IStateIndex } from '@/interfaces'; | ||
|
||
export function generateGetters(state: IStateIndex): IGetterIndex { | ||
return Object.fromEntries(Object.keys(state).map((k: string) => ([ | ||
`get${k.charAt(0).toUpperCase() + k.slice(1)}`, | ||
computed(() => unref(state[k])) | ||
]))); | ||
} | ||
|
||
export const isDebugMode: boolean = import.meta.env.MODE.toUpperCase() === 'DEBUG'; |