asv-hlps-market 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import { Shop } from "../models/Shop";
2
+ export declare const useShopId: () => number;
3
+ export declare const useShop: () => Shop;
4
+ export declare const useShopName: () => string;
5
+ export declare const useShopActions: () => {
6
+ setShop: (shop: Shop) => void;
7
+ setShopName: (name: string) => void;
8
+ setShopId: (id: number) => void;
9
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useShopActions = exports.useShopName = exports.useShop = exports.useShopId = void 0;
4
+ const zustand_1 = require("zustand");
5
+ const shallow_1 = require("zustand/react/shallow");
6
+ const shopStore = (0, zustand_1.create)((set) => ({
7
+ shop: null,
8
+ shopName: null,
9
+ shopId: null,
10
+ actions: {
11
+ setShop: (param) => set(() => ({ shop: param })),
12
+ setShopName: (param) => set(() => ({ shopName: param })),
13
+ setShopId: (param) => set(() => ({ shopId: param })),
14
+ },
15
+ }));
16
+ const useShopId = () => shopStore((s) => s.shopId);
17
+ exports.useShopId = useShopId;
18
+ const useShop = () => shopStore((s) => s.shop);
19
+ exports.useShop = useShop;
20
+ const useShopName = () => shopStore((s) => s.shopName);
21
+ exports.useShopName = useShopName;
22
+ const useShopActions = () => shopStore((0, shallow_1.useShallow)((s) => s.actions));
23
+ exports.useShopActions = useShopActions;
@@ -0,0 +1,9 @@
1
+ import { Shop } from "../models/Shop";
2
+ export declare const useShopId: () => number;
3
+ export declare const useShop: () => Shop;
4
+ export declare const useShopName: () => string;
5
+ export declare const useShopActions: () => {
6
+ setShop: (shop: Shop) => void;
7
+ setShopName: (name: string) => void;
8
+ setShopId: (id: number) => void;
9
+ };
@@ -0,0 +1,16 @@
1
+ import { create } from "zustand";
2
+ import { useShallow } from "zustand/react/shallow";
3
+ const shopStore = create((set) => ({
4
+ shop: null,
5
+ shopName: null,
6
+ shopId: null,
7
+ actions: {
8
+ setShop: (param) => set(() => ({ shop: param })),
9
+ setShopName: (param) => set(() => ({ shopName: param })),
10
+ setShopId: (param) => set(() => ({ shopId: param })),
11
+ },
12
+ }));
13
+ export const useShopId = () => shopStore((s) => s.shopId);
14
+ export const useShop = () => shopStore((s) => s.shop);
15
+ export const useShopName = () => shopStore((s) => s.shopName);
16
+ export const useShopActions = () => shopStore(useShallow((s) => s.actions));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "asv-hlps-market",
3
- "version": "1.0.35",
4
- "description": "",
3
+ "version": "1.0.36",
4
+ "description": "some markets tools",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
7
7
  "files": [