2021-04-25 08:03:30 -07:00
|
|
|
import create, { State } from 'zustand'
|
|
|
|
import produce from 'immer'
|
|
|
|
|
|
|
|
interface NotificationStore extends State {
|
|
|
|
notifications: Array<{
|
|
|
|
type: string
|
|
|
|
message: string
|
|
|
|
description?: string
|
|
|
|
txid?: string
|
|
|
|
}>
|
|
|
|
set: (x: any) => void
|
|
|
|
}
|
|
|
|
|
2021-04-27 02:28:04 -07:00
|
|
|
const useNotificationStore = create<NotificationStore>((set, _get) => ({
|
2021-04-25 08:03:30 -07:00
|
|
|
notifications: [],
|
|
|
|
set: (fn) => set(produce(fn)),
|
|
|
|
}))
|
|
|
|
|
|
|
|
export default useNotificationStore
|