This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"policyName": "Jane Dobbs", | |
"policyNumber": 98765465, | |
"dateOfBirth": "15/11/1968" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"policyName": "Adam Scott", | |
"policyNumber": 14567862, | |
"dateOfBirth": "31/08/1965" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useReducer, useCallback } from 'react'; | |
// Usage | |
function App() { | |
const { state, set, undo, redo, clear, canUndo, canRedo } = useHistory({}); | |
return ( | |
<div className="container"> | |
<div className="controls"> | |
<div className="title">👩🎨 Click squares to draw</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before | |
import React, { Component, Suspense, lazy } from "react"; | |
import ReactDOM from "react-dom"; | |
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; | |
import Home from './Home' | |
import Topics from './Topics' | |
import Settings from './Settings' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before | |
import OtherComponent from './OtherComponent'; | |
function MyComponent() { | |
return ( | |
<div> | |
<OtherComponent /> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The behaviour was this: | |
bar.toString() // 'function bar() {} | |
//now the new behaviour is: | |
bar.toString(); // 'function /* this is bar */ bar () {}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(Symbol('test description').description); // "test description" | |
console.log(Symbol.iterator.description); // "Symbol.iterator" | |
console.log(Symbol.for('test description').description); // "test description" |
NewerOlder