//declare the property so that it can be used by ts
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$socket: SocketIOClient.Socket;
}
}
const app = createApp(App)
//mount app with the vue 3 global properties api
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
{ | |
"vue 3 typescript scss ": { | |
"prefix": "vbts", | |
"description": "Vue 3 Typescript SCSS snippet", | |
"body": [ | |
"<script lang='ts'>", | |
"import { defineComponent, reactive } from 'vue';", | |
"", | |
"export default defineComponent({", | |
" name: '${TM_FILENAME_BASE}',", |
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
JavaScript 2 hrs 5 mins βββββββββββββββββββββ 88.4% | |
JSON 7 mins βββββββββββββββββββββ 5.2% | |
Vue.js 6 mins βββββββββββββββββββββ 4.8% | |
TypeScript 2 mins βββββββββββββββββββββ 1.4% | |
Markdown 0 secs βββββββββββββββββββββ 0.1% |
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
const toString = Object.prototype.toString; | |
type MaybeObjArrStrNum = | |
| { [x: string]: MaybeObjArrStrNum } | |
| (MaybeObjArrStrNum | string | number)[] | |
| string | |
| number; | |
export function sanitizeResponse(data: { |
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
export const toString = (val: any) => Object.prototype.toString.call(val) | |
export type NullToUndefined<T> = T extends null ? undefined : T | |
/** | |
* Get deep diff of objects | |
* @param toMatch base data | |
* @param newData new data | |
* @param asNullKeys convert `undefined` to `null` | |
* @returns diff | |
*/ |