Skip to content

Instantly share code, notes, and snippets.

View aiyogg's full-sized avatar
💪
Learning

Chuck aiyogg

💪
Learning
View GitHub Profile
@aiyogg
aiyogg / usePromise.tsx
Created April 9, 2024 03:23
React use Promise
import React from "react"
import type { ReactNode } from "react"
const { createContext, useContext, useRef, useState } = React;
type PromiseCanUse<T> = Promise<T> & {
status?: 'pending' | 'fulfilled' | 'rejected'
reason?: unknown
value?: T
}
@aiyogg
aiyogg / default.custom.yaml
Created September 1, 2023 03:16
Rime config
patch:
# 方案列表
schema_list:
# 可以直接删除或注释不需要的方案,对应的 *.schema.yaml 方案文件也可以直接删除。
# - schema: rime_ice # 雾凇拼音(全拼)
# - schema: double_pinyin # 自然码双拼
# - schema: double_pinyin_abc # 智能 ABC 双拼
# - schema: double_pinyin_mspy # 微软双拼
# - schema: double_pinyin_sogou # 搜狗双拼
- schema: double_pinyin_flypy # 小鹤双拼
@aiyogg
aiyogg / .eslintrc.json
Created January 15, 2018 05:59
ESLint global configure
{
"extends": "standard",
"plugins": [
"standard",
"promise"
],
"env": {
"node": true,
"mocha": true,
"es6": true,