Try:
:set clipboard=unnamed
or
:set clipboard=unnamedplus
import { useRef } from 'react'; | |
export default function useLogKeyDifferences<Type>(object: Type) { | |
const objectRef = useRef<undefined | Type>(undefined); | |
const previousObject = objectRef.current; | |
objectRef.current = object; | |
const differentKeys = new Set<keyof Type>(); | |
(Object.keys(object) as (keyof Type)[]).forEach((key) => { | |
const prev = previousObject?.[key]; | |
const current = object[key]; |
Try:
:set clipboard=unnamed
or
:set clipboard=unnamedplus
/** | |
* This is useful when you have both sync and async completions and don't want to have to wait for the async completions to resolve | |
* to show the already available sync completions. | |
*/ | |
function rerenderCompletions() { | |
editor.trigger('editor', 'hideSuggestWidget', null); | |
editor.trigger('source', 'editor.action.triggerSuggest', null); | |
} |
import React from 'react'; | |
import { useState, useCallback } from 'react'; | |
export type SetSpreadStateFn<T> = ( | |
s: Partial<T> | ((ns: T) => Partial<T>), | |
) => void; | |
export type SpreadStateReturnType<T> = [T, SetSpreadStateFn<T>]; | |
export default function useSpreadState<State>( |
import { useMemo } from 'react'; | |
/** | |
* Memoize an object based on it's keys and values. MAKE SURE the object always has the same | |
* keys and values | |
* @param object An object that will always have the same number of properties | |
*/ | |
export default function useMemoedObjectLiteral<T>(object: T): T { | |
return useMemo(() => object, Object.values(object)); | |
} |
{"lastUpload":"2020-09-16T15:22:47.632Z","extensionVersion":"v3.4.3"} |
import React, {useCallback, useRef, useLayoutEffect} from 'react'; | |
import {TextInput as RNTextInput, TextInputProps} from 'react-native'; | |
const TextInput = React.forwardRef<RNTextInput, TextInputProps>( | |
function TextInput( | |
{value, onChangeText: _onChangeText, defaultValue: _defaultValue, ...props}, | |
forwardRef, | |
) { | |
const ref = useRef<RNTextInput | null>(null); |
import React from 'react'; | |
import { | |
SafeAreaView, | |
StyleSheet, | |
KeyboardAvoidingView, | |
ScrollView, | |
Platform, | |
} from 'react-native'; | |
export default function Screen() { |
{ | |
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
{ | |
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |