https://www.akitio.com/expansion/node-pro -- great example of one https://gist.github.com/simondavies/41f71fc7d6982a28ba09 https://www.npmjs.com/package/react-cookie-consent https://github.com/Mastermindzh/react-cookie-consent https://github.com/buildo/react-cookie-banner https://github.com/Palmabit-IT/react-cookie-law https://github.com/enzsft/react-cookie-consents
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
/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ | |
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\ |
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
https://norde.io/ | |
https://github.com/tienpham94/react-awesome-spinners | |
https://github.com/davidhu2000/react-spinners | |
https://github.com/JoshK2/react-spinners-css | |
https://github.com/jameygleason/aperitif |
Hi Zach :D
Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.
First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time
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
// This is a private copy of idb-keyval vNext, which has a simpler API with many bug fixes. | |
// https://raw.githubusercontent.com/jakearchibald/idb-keyval/next/src/index.ts | |
// https://github.com/jakearchibald/idb-keyval/issues/80 (description of API) | |
// The old implementation with bug fixes from several PRs in idb-keyval is at | |
// https://github.com/DestinyItemManager/DIM/blob/master/src/app/storage/idb-keyval.ts | |
// https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Version_changes_while_a_web_app_is_open_in_another_tab | |
const DB_NAME = 'rg-app-data'; // 'keyval-store' | |
const DB_STORE = 'rg-data'; // 'keyval' |
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
// https://vanillajstoolkit.com/helpers/debounce/ | |
var debounce = function (fn) { | |
// Setup a timer | |
var timeout; | |
// Return a function to run debounced | |
return function () { | |
// Setup the arguments |
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 { useEffect, useState, useCallback, useRef } from 'react' | |
export default (asyncFunction, immediate = true) => { | |
const [loading, setLoading] = useState(false) | |
const [result, setResult] = useState(null) | |
const [error, setError] = useState(null) | |
// Track a reference to whether the useAsync is actually on a mounted component. | |
// useEffect below returns a cleanup that sets this to false. Before setting | |
// any state, we check if the cleanup has run. If it has, don't update the state. |
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 goal here is to demonstrate using a React context as a redux-like reducer-based store. | |
import { useContext } from 'react' | |
import { Store } from '../store' | |
const ACTION_ASYNC_REQUEST_SUFFIX = '@REQUEST' | |
const ACTION_ASYNC_SUCCESS_SUFFIX = '@SUCCESS' | |
const ACTION_ASYNC_FAILURE_SUFFIX = '@FAIL' |
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 { useState, useEffect } from 'react' | |
const useDebounce = (value, delay) => { | |
// State and setters for debounced value | |
const [debouncedValue, setDebouncedValue] = useState(value) | |
useEffect( | |
() => { | |
// Update debounced value after delay | |
const handler = setTimeout(() => { |
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
// A react hook to generalize the use of any class that implements the Storage interface. | |
// LocalStorage and SessionStorage are provided here but it is easy to extend to something like | |
// AsyncStorage for react native. | |
const useStorage = (key, initialValue, storage) => { | |
// Pass initial state function to useState so logic is only executed once | |
const [storedValue, setStoredValue] = useState(() => { | |
try { | |
const item = storage.getItem(key) | |
return item ? JSON.parse(item) : initialValue |