Letβs Encrypt is a free, automated, and open Certificate Authority.
- Install tools for using the Let's Encrypt certificates using Certbot
sudo apt-get update \
sudo apt-get install software-properties-common| import { useCount, useIncrement, useDecrement } from './store.Count' | |
| export default function Counter () { | |
| const count = useCount() | |
| const increment = useIncrement() | |
| const decrement = useDecrement() | |
| return ( | |
| <div> | |
| <div>Count: {count}</div> |
| const useCancellable = fn => { | |
| const requestRef = useRef(0) | |
| return async (...args) => { | |
| // Keep track of latest promise ID | |
| const id = Date.now() | |
| requestRef.current = id | |
| // Wait for resolution | |
| const res = await fn(...args) |
| function makeStore({ actions }) { | |
| // Make a context for the store | |
| const context = React.createContext(); | |
| // Make a provider that takes an initialValue | |
| const Provider = ({ initialValue = {}, children }) => { | |
| // Make a new state instance | |
| const [state, setState] = useState(initialValue); | |
| // Bind the actions with the old state and args |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | π :tada: |
| Version tag | π :bookmark: |
| New feature | β¨ :sparkles: |
| Bugfix | π :bug: |
| const cache = {} | |
| export default function useGlobalMemo (key, fn, deps) { | |
| if (!cache[key]) { | |
| cache[key] = { | |
| subs: 0, | |
| deps, | |
| value: fn(), | |
| } |
| const getMutable = (state) => JSON.parse(JSON.stringify(state)); // This is doer. | |
| const mutableState = getMutable(state); | |
| mutableState.books[0].section[2] = 'Things to be learned in august.'; | |
| mutableState.books[1].section[4] = 'Things to be learned in november.'; | |
| dispatch(mutableState); | |
| // ---------------------------------------------------------------------------------------------------------- | |
| // Antoher simple approach is using closures like immer.js does(but it does some depth comparisons too), for e.g. below is my |
Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.
Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the π£-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.