UNPKG

test-iki-mini-app

Version:

ứng dựng bán hàng trên mini app z a l o

18 lines (16 loc) 487 B
import { create } from "zustand"; import { RepositoryRemote } from "../services"; export const useVoucherStore = create((set) => ({ loading: false, allVoucher: [], getAllVoucher: async (onFail = () => {}) => { try { set({ loading: true }); const response = await RepositoryRemote.voucher.getAllVoucher(); set({allVoucher: response.data.data}) } catch (error) { onFail(error); } set({ loading: false }); } }));