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
/** ! | |
* Copyright (c) 2020, Matt Dunn | |
* | |
* @author Matt Dunn (https://matt-dunn.github.io/) | |
* @licence MIT | |
*/ | |
/** | |
* Optimised selector - similar to reselect | |
* |
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
/** ! | |
* Copyright (c) 2020, Matt Dunn | |
* | |
* @author Matt Dunn (https://matt-dunn.github.io/) | |
* @licence MIT | |
*/ | |
/** @jsx h **/ | |
// ===== State (Redux style) ===== |
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
/** ! | |
* Copyright (c) 2020, Matt Dunn | |
* | |
* @author Matt Dunn (https://matt-dunn.github.io/) | |
* @licence MIT | |
*/ | |
import { useState } from "react"; | |
function useLocalStorage<P>(key: string, initial?: P | undefined): [P | undefined, (newValue: P | undefined) => void] { |
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
/** ! | |
* Copyright (c) 2020, Matt Dunn | |
* | |
* @author Matt Dunn (https://matt-dunn.github.io/) | |
* @licence MIT | |
*/ | |
/** | |
* Example of a dependency free flux style state implementation | |
* See https://github.com/matt-dunn/state/blob/master/app/index.tsx for a typescript |