- Get Started
- Quick Start
- Tutorial: Tic-Tac-Toe
- Thinking in Zustand: motivation, principles, and glossary
- Installation
- Start a new Project: vanilla, react, and react native
- Using TypeScript
- Quick Start
- Learn Zustand
This file contains hidden or 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, createContext, useMemo, useCallback, useContext } from 'react' | |
| const AuthContext = createContext(undefined) | |
| export const AuthProvider = ({ children }) => { | |
| const [user, setUser] = useState(undefined) | |
| const [isLoading, setIsLoading] = useState(false) | |
| const [error, setError] = useState(null) | |
| const login = useCallback(async () => { |
This file contains hidden or 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 type { AnyZodObject, z } from "zod"; | |
| import type { Metadata, ResolvingMetadata } from "next"; | |
| type InferParams<Params> = Params extends readonly string[] | |
| ? { | |
| [K in Params[number]]?: string; | |
| } | |
| : Params extends AnyZodObject | |
| ? z.infer<Params> | |
| : unknown; |
This file contains hidden or 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
| /* eslint-disable unicorn/no-process-exit */ | |
| const { spawn } = require("child_process"); | |
| const pkg = require("./package.json"); | |
| const dependencies = Object.keys(pkg.dependencies || {}); | |
| const devDependencies = Object.keys(pkg.devDependencies || {}); | |
| const pkgRegex = new RegExp(process.argv.slice(2)[0]); | |
| const latestDependencies = dependencies | |
| .concat(devDependencies) |
This file contains hidden or 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
| $0.toBlob(b => window.open(window.URL.createObjectURL(b), '_blank')) |
This file contains hidden or 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
| { | |
| "autostart": true, | |
| "user-auth": { | |
| "autologin": true, | |
| "username": "jane.doe", | |
| "password": "very-secret-Let-Me-!n-P4ssword" | |
| } | |
| } |
http://gnuwin32.sourceforge.net/downlinks/make.php
Use the next command to open it in the explorer
explorer $(where wintoast.exe | sed -r 's/\\wintoast\.exe//g')- https://docs.google.com/presentation/d/1RERYkEulkoNYN_X2Kz67Szdn3ylPyBpmvVjzmyZ0nPE/edit?usp=sharing
- https://docs.google.com/presentation/d/1VYTIykxAdZKkhoWVfRstY4C9img2_ZBhjl73Va_-oZg/edit?usp=sharing
- https://docs.google.com/presentation/d/1jJbBnvKWH9ia2cfFdZJiC9Cuz1g4Tiy5idI-BQzF7ns/edit?usp=sharing
- https://docs.google.com/presentation/d/10WOyTeVlP-aAzIlhcx10lyww54silswxLgnvZ5gmY-k/edit?usp=sharing
- https://docs.google.com/presentation/d/1ugG4xmJgmJDA6f6EokjF8LSDd2CNROaTzVt1BqHOqJk/edit?usp=sharing
- https://docs.google.com/presentation/d/1S9VLdvv7xp_JuW8jN8L9OEsON8wchJPXqb0ah4kESd4/edit?usp=sharing
- https://docs.google.com/presentation/d/1V2F2HkQmFHET4acey3BDamtXDvuwVsrmwtRac8607IY/edit?usp=sharing
- https://docs.google.com/presentation/d/10AAn9RmyDv0gC4wVr7bWeGYG0_jbThPhHT0EyadzBLY/edit?usp=sharing
- https://docs.google.com/presentation/d/13icIf8i76F-j9PZcHWDc6g5OEwuKVOvqHfmxAJcp8c8/edit?usp=sharing
- https://docs.google.com/presentation/d/1S9VLdvv7xp_JuW8jN8L9OEsON8wchJPXqb0ah4kESd4/edit?usp=sh
Clone a new project for a new account
GIT_SSH_COMMAND='ssh -i ~/.ssh/<id_rsa_custom>' git clone [email protected]:<your-project>.gitConfigure git to use the custom GIT_SSH_COMMAND
git config core.sshCommand 'ssh -i ~/.ssh/'
This file contains hidden or 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
| // contexts/auth-context.js | |
| import React, { useReducer, useContext, createContext } from 'react' | |
| export const AuthStateContext = createContext() | |
| export const AuthDispatchContext = createContext() | |
| export const AuthProvider = ({ initialState, reducer, children }) => { | |
| const [state, dispatch] = useReducer(reducer, initialState) | |
NewerOlder