Procházet zdrojové kódy

Restore useLabelStore mistakenly removed in commit 403e2d58 (#24052)

Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
tags/1.8.0
Yongtao Huang před 2 měsíci
rodič
revize
ff52a54fef
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 15 přidání a 0 odebrání
  1. 15
    0
      web/app/components/tools/labels/store.ts

+ 15
- 0
web/app/components/tools/labels/store.ts Zobrazit soubor

@@ -0,0 +1,15 @@
import { create } from 'zustand'
import type { Label } from './constant'

type State = {
labelList: Label[]
}

type Action = {
setLabelList: (labelList?: Label[]) => void
}

export const useStore = create<State & Action>(set => ({
labelList: [],
setLabelList: labelList => set(() => ({ labelList })),
}))

Načítá se…
Zrušit
Uložit