This file contains 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
import { DiggyDB, DiggyQuery } from "diggydb-nodejs" | |
const db = new DiggyDB({ | |
hostname: "example.com" | |
}) | |
interface Framework { | |
id: string | |
name: string | |
version: string |
This file contains 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
import { v4 as uuidv4 } from "uuid" | |
import { DiggyDB, DiggyQuery } from "diggydb-nodejs" | |
const db = new DiggyDB({ | |
hostname: "example.com", | |
accessKeyId: process.env.AWS_ACCESS_KEY_ID, | |
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | |
}) | |
interface Framework { |
This file contains 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 person = { | |
firstName: "Jane", | |
lastName: "Bloggs", | |
email: "jane@example.com", | |
phone: "0123456789" | |
}; | |
console.log(person.email); | |
// expected output: "jane@example.com" | |
delete person.email; | |
console.log(person.email); |
This file contains 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 person = { | |
firstName: "Jane", | |
lastName: "Bloggs", | |
email: "jane@example.com", | |
phone: "0123456789" | |
}; | |
const { | |
email, | |
...personWithoutEmail |
This file contains 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 person = { | |
firstName: "Jane", | |
lastName: "Bloggs", | |
email: "jane@example.com", | |
phone: "0123456789" | |
}; | |
const omitKey = (data, key) => { | |
const { [key]: _, ...rest } = data | |
return rest |
This file contains 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
interface Person { | |
firstName: string; | |
lastName: string; | |
email: string; | |
phone: string; | |
} | |
const person: Person = { | |
firstName: "Jane", | |
lastName: "Bloggs", |
This file contains 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 person = { | |
firstName: "Jane", | |
lastName: "Bloggs", | |
email: "jane@example.com", | |
phone: "0123456789" | |
}; | |
const omitKey = <T, K extends keyof T>(data: T, key: K) => { | |
const { [key]: _, ...o } = data; | |
return o; |
This file contains 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
interface Person { | |
firstName: string; | |
lastName: string; | |
email: string; | |
phone: string; | |
} | |
type PersonWithoutEmail = Omit<Person, "email"> | |
type PersonWithoutEmailOrPhone = Omit<Person, "email" | "phone"> |
This file contains 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
import React from 'react' | |
import { useGoogleOptimize } from '@heights/react-use-google-optimize' | |
const App = () => { | |
const [isVariation] = useGoogleOptimize("OPTIMIZE_EXPERIMENT_ID") | |
return ( | |
<> | |
<h1>{ isVariation ? "This is a variant" : "This is control" }</h1> | |
</> |
This file contains 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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"babel-preset-gatsby", | |
{ | |
"reactRuntime": "automatic" | |
} | |
] | |
] | |
} |