just the bare necessities of state management.
Hotlink it from https://unpkg.com/valoo
.
// when T is any|unknown, Y is returned, otherwise N | |
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
// when T is never, Y is returned, otherwise N | |
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
// when T is a tuple, Y is returned, otherwise N | |
// valid tuples = [string], [string, boolean], | |
// invalid tuples = [], string[], (string | number)[] |
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
// TypeScript Fundamentals For JavaScript Developers | |
/* | |
Tutorial for JavaScript Developers wanting to get started with TypeScript. | |
Thorough walkthrough of all the basic features. | |
We will go through the basic features to gain a better understanding of the fundamentals. | |
You can uncomment the features one by one and work through this tutorial. | |
If you have any questions or feedback please connect via Twitter: | |
A. Sharif : https://twitter.com/sharifsbeat | |
*/ |
just the bare necessities of state management.
Hotlink it from https://unpkg.com/valoo
.
Try to be mindful of your words in written communications. Here are some tricks to leaving a good impression with written words online.
When writing imperative sentences, try not to start your sentences with "don't." Try the word "avoid" instead.
⚠️ "Don't use big words."
This imperative command can make the reader feel like they have no choice on the matter. It implies that the decision lies solely on you, which implies that you don't want to listen to their feedback.
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<!-- Viewport --> | |
<meta name="viewport" content="width=device-width, minimum-scale = 1.0, initial-scale = 1.0, maximum-scale = 5.0, user-scalable=yes, shrink-to-fit=no"> | |
<title>Title of the Page</title> | |
rebase
vs merge
).rebase
vs merge
)reset
vs checkout
vs revert
)git rev-parse
)pull
vs fetch
)stash
vs branch
)reset
vs checkout
vs revert
)Implementation of redux inside any react.js or react-native application,
100+ different js counter apps... |