This file contains hidden or 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
1. React Query là gì và tại sao nên sử dụng nó? | |
2. Các hooks cơ bản trong React Query? | |
3. Query Keys là gì và cách sử dụng? | |
4. Cách handle loading và error states? | |
5. Cách implement infinite scrolling với React Query? | |
6. Cách configure stale time và cache time? | |
7. Cách prefetch data? | |
8. Cách implement dependent queries? | |
9. Cách handle retry logic? | |
10. Cách implement polling với React Query? |
This file contains hidden or 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 from "express"; | |
import { PrismaClient } from "@prisma/client"; | |
import { hash, compare } from "bcrypt"; | |
import jwt from "jsonwebtoken"; | |
const prisma = new PrismaClient(); | |
const app = express(); | |
app.use(express.json()); |
This file contains hidden or 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
class Todo { | |
constructor(text, finished) { | |
this.id = String(Date.now()); | |
this.text = text; | |
this.finished = finished; | |
} | |
} | |
class InputDOM { | |
constructor() { |
This file contains hidden or 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
// Name, email, phone, location, age, picture | |
// Events listener: click (generate user) | |
const btnTag = document.querySelector("#generate"); | |
function fetchUser() { | |
fetch("https://randomuser.me/api") | |
.then((response) => response.json()) | |
.then((data) => { | |
const randomUser = data.results[0]; |
This file contains hidden or 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
let randomUser; | |
fetch("https://randomuser.me/api") | |
.then((response) => { | |
return response.json(); | |
}) | |
.then((data) => { | |
randomUser = data.results[0]; | |
console.log(randomUser); |
This file contains hidden or 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 itemForm = document.getElementById("item-form"); | |
const itemInput = document.getElementById("item-input"); | |
const itemList = document.getElementById("item-list"); | |
const clearBtn = document.getElementById("clear"); | |
const filterInput = document.getElementById("filter"); | |
const liInItems = document.querySelectorAll(".items > li"); | |
function createElement(tag, className, text) { | |
const elm = document.createElement(tag); |
This file contains hidden or 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 express = require("express"); | |
// Create express instance | |
const app = express(); | |
// accept json data | |
app.use(express.json()); | |
// Http Method | |
/** |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Grand Hotel</title> | |
<link rel="shortcut icon" type="image/png" href="img/crown.png" /> | |
<link | |
rel="stylesheet" |
This file contains hidden or 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 Categories from "./Categories"; | |
import Menus from "./Menus"; | |
const menu = [ | |
{ | |
id: 1, | |
title: "buttermilk pancakes", | |
category: "breakfast", | |
price: 15.99, |
This file contains hidden or 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
/* *-*-*-*-*-*-*-*-*-*-* Challenge 1 ------------------ | |
Create a variable with the type number and assign it an arbitrary value | |
*/ | |
// ---------------------------------------------------- | |
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- | |
// ---------------------------------------------------- | |
/* *-*-*-*-*-*-*-*-*-*-* Challenge 2 ------------------ | |
Create a variable with the type string and use the addition operator to put two arbitrary words together | |
*/ |
NewerOlder