@rango-dev/widget-embedded 0.39.1-next.17 → 0.39.1-next.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.39.1-next.17",
3
+ "version": "0.39.1-next.18",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,15 +25,15 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.6.1-next.0",
28
- "@rango-dev/provider-all": "^0.42.1-next.15",
28
+ "@rango-dev/provider-all": "^0.42.1-next.14",
29
29
  "@rango-dev/queue-manager-core": "^0.27.1-next.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.42.1-next.7",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.42.1-next.6",
31
31
  "@rango-dev/queue-manager-react": "^0.27.1-next.0",
32
32
  "@rango-dev/signer-solana": "^0.36.1-next.1",
33
- "@rango-dev/ui": "^0.43.1-next.8",
34
- "@rango-dev/wallets-core": "^0.40.1-next.14",
35
- "@rango-dev/wallets-react": "^0.27.1-next.16",
36
- "@rango-dev/wallets-shared": "^0.41.1-next.7",
33
+ "@rango-dev/ui": "^0.43.1-next.7",
34
+ "@rango-dev/wallets-core": "^0.40.1-next.13",
35
+ "@rango-dev/wallets-react": "^0.27.1-next.15",
36
+ "@rango-dev/wallets-shared": "^0.41.1-next.6",
37
37
  "bignumber.js": "^9.1.1",
38
38
  "copy-to-clipboard": "^3.3.3",
39
39
  "dayjs": "^1.11.7",
@@ -54,4 +54,4 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  }
57
- }
57
+ }
@@ -0,0 +1,19 @@
1
+ import type { StateCreator } from 'zustand';
2
+
3
+ /**
4
+ * you can wrap your slice in this middleware, it will update `lastUpdatedAt` for that slice when a zustand's `set` is calling
5
+ */
6
+ export const keepLastUpdated: <Store, Slice extends { lastUpdatedAt: number }>(
7
+ config: StateCreator<Store, [], [], Slice>
8
+ ) => StateCreator<Store, [], [], Slice> = (slice) => (set, get, api) => {
9
+ const modifedSet: typeof set = (...params) => {
10
+ set((state) => {
11
+ return {
12
+ ...state,
13
+ lastUpdatedAt: +new Date(),
14
+ };
15
+ });
16
+ set(...params);
17
+ };
18
+ return slice(modifedSet, get, api);
19
+ };