Created
December 25, 2023 02:06
-
-
Save DarkRoku12/0935ef9062878d67e444a3497cbba826 to your computer and use it in GitHub Desktop.
React constants for custom hook.
This file contains hidden or 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
/** Created by DarkRoku12 */ | |
export const SymbolAddWatcher = Symbol("__addWatcher"); | |
export const SymbolForAll = Symbol("__forAll"); | |
export type RecordIndex = string | number | symbol; | |
export type AnyRecord = Record<RecordIndex, any>; | |
export type RecordObj<T extends AnyRecord> = T & AnyRecord; | |
// eslint-disable-next-line @typescript-eslint/ban-types | |
export type Watched<T extends AnyRecord> = RecordObj<T> & { [SymbolAddWatcher]: Function }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment