mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
17 lines
481 B
TypeScript
17 lines
481 B
TypeScript
import { create } from 'zustand'
|
|
|
|
interface UserBashStore {
|
|
userBashCommands: Map<string, number> // command -> timestamp
|
|
addUserBashCommand: (command: string) => void
|
|
}
|
|
|
|
export const useUserBash = create<UserBashStore>((set) => ({
|
|
userBashCommands: new Map(),
|
|
addUserBashCommand: (command: string) => {
|
|
set((state) => {
|
|
const newMap = new Map(state.userBashCommands)
|
|
newMap.set(command, Date.now())
|
|
return { userBashCommands: newMap }
|
|
})
|
|
},
|
|
})) |