What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-05 18:35:24
Expected an assignment or function call and instead saw an expression
Make sure to include "return()" within the code block. export const Example = () => { return ( <div> <p>Don't forget "return" within your code block.</p> </div> ) } Add solution -
Javascript 2021-11-04 00:08:06
graphql upload express
//resolvers.js export default { Query: { usersActivation() { return 'Hello Wordl' } }, Mutation: { uploadFile: async (parent, { file }) => { const { filename, createReadStream } = await file.promise fileUpload({ filename, stream: cre... Add solution -
TypeScript 2021-10-29 21:01:11
mongoose typescript global promise
import mongoose from 'mongoose' import consola from 'consola' import q from 'q' export const mongooseConnection = (): void => { mongoose.Promise = q.Promise mongoose.connect(process.env.MONGO_URI, { minPoolSize: 1, maxPoolSize: 20, compressio... Add solution -
Javascript 2021-10-29 18:22:20
inbound email sendgrid cloud functions
import * as functions from 'firebase-functions'; import * as express from 'express'; const formidable = require('formidable-serverless'); export class InboundEmail { constructor(from, subject, text, html, to) {} doStrategy() { //Store inbound em... Add solution -
TypeScript 2021-10-28 09:40:12
pub schedule firebase
import {EventContext} from 'firebase-functions'; // There is an allowance of three free jobs per Google account // For example, to run a function every five minutes with // AppEngine cron.yaml syntax, do something like this: export const scheduledFunct... Add solution -
Javascript 2021-10-27 13:10:13
javascript nameof
// TypeScript // NameOf.ts export const NameOf = <T>(name: keyof T) => name; // Setup class User { Name: string; Age: number; } // Usage import {NameOf} from './NameOf'; function UseNameOf() { console.log(NameOf<User>('Name')); } /... Add solution -
Javascript 2021-10-26 19:58:08
toast notification bootstrap react js github
import { useToasts } from 'react-toast-notifications' export const ToastDemo = ({ content }) => { const { addToast } = useToasts() return ( <Button onClick={() => addToast(content, { appearance: 'warning', autoDismiss: true, ... Add solution -
Shell/Bash 2021-10-25 19:29:15
npm install router
//Installing Vue Router npm install vue-router //Implementation //main.js - Add below lines import VueRouter from 'vue-router'; Vue.use(VueRouter); const router = new VueRouter({ routes, mode: 'history' }); new Vue({ router, render: h => h(... Add solution