This is yet another explanation of why async and return await is pointless, coming from this post.
// async means that this:
const fn = async (...args) => {/* stuff */};
// is basically the equivalent of this:This is yet another explanation of why async and return await is pointless, coming from this post.
// async means that this:
const fn = async (...args) => {/* stuff */};
// is basically the equivalent of this:It's React Hooks for Remote Data Fetching, a hook designed to render data on demand.
import useSWR from 'swr'
function Profile() {
const { data, error } = useSWR('/api/user', fetcher);A very simple comparison table between these two libraries.
| uce | lit-element | |
|---|---|---|
| version | 1.11.9 | 2.4.0 |
| license | ISC (simplified MIT) | BSD-3-Clause License |
| language | JS w/ TS definition | TS w/ JS transpilation |
| size ( brotli ) | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Oled Update</title> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
| <script type="module"> | |
| import CommonJS from '/electroff?module'; | |
| // works within an async closure, ofering some utils |
TL;DR enough of this kind of nonsense
I've been in the field for ~20 years and started as BE developer, and this is a reference for people thinking that because they are on the BE side, they're somehow entitled to:
| // it notifies about the highest peak, and it logs it in console | |
| // it also saves it to the window.participants property | |
| (function () { | |
| var max = 0; | |
| var timer = 0; | |
| var target = document.querySelector('[type="participants"]'); | |
| var Notification = self.Notification || {permission: 'denied'}; | |
| (new MutationObserver(() => { | |
| var now = Math.max(parseInt(target.innerText.trim()), max); | |
| if (max < now) { |
| #!/usr/bin/env bash | |
| echo "" | |
| echo "benchmarking $(tput bold)$1$(tput sgr0)" | |
| echo "" | |
| case $1 in | |
| nginx ) | |
| sudo systemctl start nginx.service ;; | |
| express ) |
The following represents this typing:
1. this is parent
1. this is child 1
* this is parent
* this is child 1
| import {define as hookedDefinition} from 'hooked-elements'; // or wicked- | |
| import css from 'ustyler'; | |
| export const define = (selector, definition) => { | |
| // let the library throw on duplicated selectors | |
| const result = hookedDefinition(selector, definition); | |
| // add styles for this selector | |
| if (definition.style) css(definition.style); | |
| // return the wicked/hooked magic 🌈 | |
| return result; |