Skip to content

Instantly share code, notes, and snippets.

const If = expression => {
let call = true, value;
return {
then: callback => Promise.resolve(value).then(callback),
Then(callback) {
if (call && expression) {
call = false;
value = callback(expression);
}
return this;
// 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;
@sajadmsNew
sajadmsNew / hyper-lit.md
Created September 24, 2021 21:48 — forked from WebReflection/hyper-lit.md
lit-html is awesome, but it came afterwards

The history of hyperHTML followed by lit-html

While many remember the epic hyperHTML: A Virtual DOM Alternative post I've published the 5th of March 2017, the first official implementation of the library was working as hyperHTML.bind(node) function for tagged literals the day before, and it's been in my experiments folder already for a little while.

The hilarious reaction from the skeptical community

At first glance people couldn't believe performance of the DBMonster demo shown in that article,

@sajadmsNew
sajadmsNew / CorruptedCoundtown.js
Created June 23, 2021 17:15 — forked from rezaerami/CorruptedCoundtown.js
this is a working countdown, but it has some issues
import React, { useState, useEffect } from "react";
import "./styles.css";
const Countdown = ({ dueDate }) => {
const [remaningTime, setRemaining] = useState();
console.log("re-render");
useEffect(() => {
setRemaining(getDateDiff(dueDate));
@sajadmsNew
sajadmsNew / loading.css
Created May 23, 2021 12:25 — forked from colbyfayock/loading.css
CSS Loading Animation
/**
* Loading Animation Snippet
*/
.loading {
color: transparent;
background: linear-gradient(100deg, #eceff1 30%, #f6f7f8 50%, #eceff1 70%);
background-size: 400%;
animation: loading 1.2s ease-in-out infinite;
}