GHHG10's picture
download
raw
573 Bytes
import type { WorkerPoolManager } from "@pierre/diffs/worker"
import { createSimpleContext } from "./helper"
export type WorkerPools = {
unified: WorkerPoolManager | undefined
split: WorkerPoolManager | undefined
}
const ctx = createSimpleContext<WorkerPools, { pools: WorkerPools }>({
name: "WorkerPool",
init: (props) => props.pools,
})
export const WorkerPoolProvider = ctx.provider
export function useWorkerPool(diffStyle: "unified" | "split" | undefined) {
const pools = ctx.use()
if (diffStyle === "split") return pools.split
return pools.unified
}

Xet Storage Details

Size:
573 Bytes
·
Xet hash:
7c7e6cb5a06520dddecce23a514b12f806d0bf545a13b48e0fe226d92d534713

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.