Do not use require
s or top-level import
s (if you're transpiling server side code).
Replace all occurrences with await import
and wrap your code in a async function
.
If your original code was:
function generateCodeVerifier() { | |
return Array(128) | |
.fill('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~') | |
.map(x => x[Math.floor(crypto.getRandomValues(new Uint32Array(1))[0] / (0xffffffff + 1) * x.length)]) | |
.join(''); | |
} | |
async function generateCodeChallenge(code_verifier) { | |
const encoder = new TextEncoder(); | |
const data = encoder.encode(code_verifier); |
Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)
Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.
Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.
// WARNING: There's much more to know/do around hooks, and | |
// this is just a simplification of how these work. | |
// shared references, updated | |
// per each hook invoke | |
let execution = null; | |
let current = null; | |
let context = null; | |
let args = null; |
""" | |
Save all gists from GitHub, including comments. | |
Requires the PyGithub library (``pip install PyGithub>=1.47``). | |
Pass a personal access token with the scope "gist" as the first | |
argument. | |
This probably won't work for large files (+10MiB), since they aren't | |
returned by the GitHub API, and must be cloned instead. |
#!/bin/bash | |
#enable nullglob on startup if not enabled | |
shopt -q nullglob || shopt -s nullglob; | |
# Turns the given value into an array and verifies that the array has more than zero elements | |
# to check if the globbed file directory given exists | |
# requires nullglob to be or it will enable/disable during the function execution | |
glob_exists() { | |
shopt -q nullglob || (echo "nullglob must be enabled for glob_exists to work." && return 1); |
cache: | |
paths: | |
- node_modules/ | |
- .yarn | |
stages: | |
- build | |
- test | |
- deploy | |
build: | |
image: node:10 |