Skip to content

Instantly share code, notes, and snippets.

@tomaspietravallo
Created July 5, 2021 21:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaspietravallo/cb6bf63dd2abfef310f01b90ec7aa7e7 to your computer and use it in GitHub Desktop.
Save tomaspietravallo/cb6bf63dd2abfef310f01b90ec7aa7e7 to your computer and use it in GitHub Desktop.
Type for objects composed of Scalar/String/Boolean signals, that get snapshot'ed to their vanilla counterparts
type ReactiveToVanilla<Obj> = {
[Property in keyof Obj]:
Obj[Property] extends ScalarSignal ? number :
Obj[Property] extends StringSignal ? string :
Obj[Property] extends BoolSignal ? boolean
: any
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment