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 { useState } from "react"; | |
import cx from "classnames"; | |
const App = () => { | |
const [todoValue, setTodoValue] = useState(""); | |
const [todos, setTodos] = useState([ | |
{ | |
id: 0, | |
value: "test todo element 1", |
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 fetch from 'node-fetch'; | |
const fetchUserDetailsById = async (id) => { | |
const data = await fetch(`https://jsonplaceholder.typicode.com/users/${id}`) | |
return await data.json() | |
} | |
const userIdsToFetch = [1,2]; | |
const fetchTodosById = async (id) => { |
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 fetch from 'node-fetch'; | |
const fetchUserDetailsById = async (id) => { | |
const data = await fetch(`https://jsonplaceholder.typicode.com/users/${id}`); | |
return data.json(); | |
}; | |
const userIdsToFetch = [1, 2]; | |
const fetchTodosById = async (id) => { |
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 promiseWithMilliseconds = (ms, index) => { | |
return new Promise((resolve,reject) => { | |
console.time(`Time:${index}`) | |
setTimeout(() => { | |
console.timeEnd(`Time:${index}`) | |
return resolve(`Resolved in ${ms}`) | |
}, ms); | |
}) | |
.catch((error) => console.log(error)) | |
} |
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 promiseWithMilliseconds = (ms, index) => { | |
return new Promise((resolve,reject) => { | |
console.time(`Time:${index}`) | |
setTimeout(() => { | |
console.timeEnd(`Time:${index}`) | |
return resolve(`Resolved in ${ms}`) | |
}, ms); | |
}) | |
} |
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 promiseWithMilliseconds = (ms, index) => { | |
return new Promise((resolve,reject) => { | |
console.time(`Time:${index}`) | |
setTimeout(() => { | |
console.timeEnd(`Time:${index}`) | |
return resolve(`Resolved in ${ms}`) | |
}, ms); | |
}) | |
} |
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 promiseWithMilliseconds = (ms, index) => { | |
return new Promise((resolve,reject) => { | |
console.time(`Time:${index}`) | |
setTimeout(() => { | |
console.timeEnd(`Time:${index}`) | |
return resolve(`Resolved in ${ms}`) | |
}, ms); | |
}) | |
} |
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 {useRouter} from 'next/router' | |
import styles from './products.module.css' | |
import {ProductType} from "./index"; | |
import {GetStaticPropsContext} from "next"; | |
import Image from 'next/image'; | |
type ProductDescriptionPagePropsType = { | |
product: ProductType; | |
} |
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 styles from './products.module.css'; | |
import {Grid} from "@mui/material"; | |
import Link from 'next/link' | |
import Image from 'next/image'; | |
export type ProductType = { | |
id: number, | |
title: string, | |
description: string, | |
price: number, |
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 express, { Application , Request, Response} from 'express'; | |
import nodemailer from "nodemailer"; | |
import handlebars from "handlebars"; | |
const transporter = nodemailer.createTransport({ | |
host: 'smtp.ethereal.email', | |
port: 587, | |
secure: false, | |
requireTLS: true, |
NewerOlder