Skip to content

Commit

Permalink
(fix) Update dummy StoreApi to work with Zustand 4.4+ (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher authored Aug 29, 2024
1 parent 1a76b8b commit f248c15
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions packages/framework/esm-config/src/module-config/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export function getExtensionConfig(
const selector = (configStore: ExtensionsConfigStore) => configStore.configs[slotName]?.[extensionId];

return {
getInitialState() {
return selector(extensionConfigStore.getInitialState());
},
getState() {
return selector(extensionConfigStore.getState()) ?? { loaded: false, config: null };
},
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/esm-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"zustand": "^4.3.6"
"zustand": "^4.5.5"
},
"peerDependencies": {
"@openmrs/esm-globals": "5.x"
Expand Down
28 changes: 20 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ __metadata:
resolution: "@openmrs/esm-state@workspace:packages/framework/esm-state"
dependencies:
"@openmrs/esm-globals": "workspace:*"
zustand: "npm:^4.3.6"
zustand: "npm:^4.5.5"
peerDependencies:
"@openmrs/esm-globals": 5.x
languageName: unknown
Expand Down Expand Up @@ -18332,7 +18332,16 @@ __metadata:
languageName: node
linkType: hard

"use-sync-external-store@npm:1.2.0, use-sync-external-store@npm:^1.2.0":
"use-sync-external-store@npm:1.2.2":
version: 1.2.2
resolution: "use-sync-external-store@npm:1.2.2"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
checksum: 10/671e9c190aab9a8374a5d468c6ba17f52c38b6fae970110bc196fc1e2b57204149aea9619be49a1bb5207fb6e51d8afd19c3bcb94afe61813fed039821461dc0
languageName: node
linkType: hard

"use-sync-external-store@npm:^1.2.0":
version: 1.2.0
resolution: "use-sync-external-store@npm:1.2.0"
peerDependencies:
Expand Down Expand Up @@ -19467,19 +19476,22 @@ __metadata:
languageName: node
linkType: hard

"zustand@npm:^4.3.6":
version: 4.3.6
resolution: "zustand@npm:4.3.6"
"zustand@npm:^4.5.5":
version: 4.5.5
resolution: "zustand@npm:4.5.5"
dependencies:
use-sync-external-store: "npm:1.2.0"
use-sync-external-store: "npm:1.2.2"
peerDependencies:
immer: ">=9.0"
"@types/react": ">=16.8"
immer: ">=9.0.6"
react: ">=16.8"
peerDependenciesMeta:
"@types/react":
optional: true
immer:
optional: true
react:
optional: true
checksum: 10/e5fc9b2324808b2644bcb67bcb8c1c4d2ffdc6f1d1d882d76c4d6891d8a0ada7479a4fa49c18a14ef45fd15035f5024713d03c1f9f1280446c4aa7fbe898d930
checksum: 10/481b8210187b69678074a1ca51107654c2379688e90407bfcb7961e0803a259742bfd0d77171c3f07e290896ad55fe9659b3863f30d34cb2572650ead1249f25
languageName: node
linkType: hard

0 comments on commit f248c15

Please sign in to comment.