What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-11-06 06:42:11
class-transformer default value
import { Transform, Expose } from 'class-transformer' import { cloneDeep } from 'lodash' export function Default(defaultValue: unknown): PropertyDecorator { return Transform((value: unknown) => value ?? cloneDeep(defaultValue)) } ... Add solution -
Javascript 2021-10-10 12:09:08
use chatbox in wix corvid
import wixChat from 'wix-chat-backend'; import wixData from 'wix-data'; let options = { "suppressAuth": true, "suppressHooks": false }; export function saveChannel(participantId, channelId) { // see events.js let toSave = { "_... Add solution -
Javascript 2021-10-03 18:33:05
react native cognito passwordless
export function sendAuthCode(email) { const loginDetails = new AuthenticationDetails({ Username: email }); const preAuthCognitoUser = createCognitoUser(email); preAuthCognitoUser.setAuthenticationFlowType("CUSTOM_AUTH"); return new Prom... Add solution -
Javascript 2021-09-29 11:20:02
redux saga use navigation
// RootNavigation.js import { createNavigationContainerRef } from '@react-navigation/native'; export const navigationRef = createNavigationContainerRef() export function navigate(name, params) { if (navigationRef.isReady()) { navigationRef.naviga... Add solution -
Javascript 2021-09-25 12:42:07
custom hook for unique items in react
// useUnique.js export function useUnique(initial) { const [items, setItems] = useState(initial); const add = newItem => { const uniqueItems = [...new Set([...items, newItem])]; setItems(uniqueItems); }; return [items, add]; }; Add solution
Best helpers
Ranking is empty