Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

TWIL Immer Demo

This is a quick demo of Immer.js

From this video

Instructions

  • npm install
  • node index.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./styles.scss">
</head>
<body>
<div id="root"></div>
{
"name": "Yes, That Joel Shinness"
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./styles.scss">
</head>
<body>
<div id="root"></div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./index.scss">
</head>
<body>
<div id="root"></div>
@JoelCodes
JoelCodes / index.html
Last active April 8, 2020 15:20
React Ref methods demo
<!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>Document</title>
</head>
<body>
<div id="root"></div>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!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>Document</title>
<link href="https://fonts.googleapis.com/css?family=Baskervville&display=swap" rel="stylesheet">
<style>
*{
import { IntCodeState, fromProgramString, compute, IntCodeTape, pushInput, popOutput, computeTillStop, computeTillOutput } from "./index";
const largeExample:string = '3,21,1008,21,8,20,1005,20,22,107,8,21,20,1006,20,31,1106,0,36,98,0,0,1002,21,125,20,4,20,1105,1,46,104,999,1105,1,46,1101,1000,1,20,4,20,1105,1,46,98,99'
const quine:string = '109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99';
const bigOutput:string = '104,1125899906842624,99';
const bigMult:string = '1102,34915192,34915192,7,4,7,99,0';
const ioHalt:string = '3,0,4,0,99'
describe('IntCode', ():void => {
describe('fromInputString(input)', ():void => {