Skip to content

Instantly share code, notes, and snippets.

View Blithe-Chiang's full-sized avatar
💭
I may be slow to respond.

Blithe-Chiang

💭
I may be slow to respond.
  • Fujian, China
  • 06:29 (UTC +08:00)
View GitHub Profile
import fs from "node:fs";
import path from "node:path";
import { parse } from "@babel/parser";
import traverse from "@babel/traverse";
import { csvWrite } from "./utils.js";
// 解析文件内容为 AST
const parseFile = (code) => {
return parse(code, {
sourceType: "module",
@Blithe-Chiang
Blithe-Chiang / CFlatList.tsx
Last active June 17, 2024 02:53
CFlatList
import { useMemoizedFn, useMount, useUnmountedRef } from "ahooks";
import React, { useState } from "react";
import { FlatList, FlatListProps } from "react-native";
interface CFlatListProps<ItemT> {
onFetch: (
isRefresh: boolean,
success: (data: ItemT[], pageSize: number) => void,
fail: (err: string) => void
) => void;
@Blithe-Chiang
Blithe-Chiang / MyStore.ts
Created May 12, 2024 03:02
zustand简单封装
// deps: zustand, immer
import { create } from "zustand";
import { immer } from "zustand/middleware/immer";
export type TStore<T> = ReturnType<typeof createStore<T>>
export function createStore<T>(initState: T) {
return create<T>()(
immer((set) => ({
@Blithe-Chiang
Blithe-Chiang / docker-compose.yml
Last active April 27, 2021 12:32
docker-compose 网络测试
version: "3.3"
# 启动两个服务
services:
box1:
# 设置容器名字
container_name: box1
image: shooan/hello
# 连接到new网络
networks: