@absolutejs/absolute 0.19.0-beta.336 → 0.19.0-beta.338
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/dist/angular/browser.js +33 -11
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +33 -11
- package/dist/angular/index.js.map +3 -3
- package/dist/client/index.js +33 -11
- package/dist/client/index.js.map +3 -3
- package/dist/islands/browser.js +33 -11
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +33 -11
- package/dist/islands/index.js.map +3 -3
- package/dist/islands/server.js +33 -11
- package/dist/islands/server.js.map +3 -3
- package/dist/react/browser.js +33 -11
- package/dist/react/browser.js.map +3 -3
- package/dist/react/hooks/index.js +33 -11
- package/dist/react/hooks/index.js.map +3 -3
- package/dist/react/index.js +33 -11
- package/dist/react/index.js.map +3 -3
- package/dist/src/client/islandStore.d.ts +6 -2
- package/dist/svelte/browser.js +33 -11
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +33 -11
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/browser.js +33 -11
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +33 -11
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/angular/index.js
CHANGED
|
@@ -39746,23 +39746,45 @@ var initializeIslandStores = (state) => {
|
|
|
39746
39746
|
};
|
|
39747
39747
|
globalThis.__ABS_ISLAND_STATE__ = nextSnapshot;
|
|
39748
39748
|
for (const [storeId, store] of getIslandStores()) {
|
|
39749
|
-
|
|
39749
|
+
for (const instance of store) {
|
|
39750
|
+
instance.applyExternalSnapshot(nextSnapshot[storeId] ?? {});
|
|
39751
|
+
}
|
|
39750
39752
|
}
|
|
39751
39753
|
};
|
|
39752
|
-
var createIslandStore = (storeId
|
|
39754
|
+
var createIslandStore = (storeId, createState) => {
|
|
39755
|
+
const store = createStore(createState);
|
|
39753
39756
|
const stores = getIslandStores();
|
|
39754
|
-
const
|
|
39755
|
-
if (existingStore) {
|
|
39756
|
-
return existingStore;
|
|
39757
|
-
}
|
|
39758
|
-
const store = createStore()(createState);
|
|
39757
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
39759
39758
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
39760
39759
|
applySnapshot(store, initialSnapshot);
|
|
39761
|
-
|
|
39760
|
+
let isApplyingExternalSnapshot = false;
|
|
39761
|
+
const applyExternalSnapshot = (snapshot) => {
|
|
39762
|
+
isApplyingExternalSnapshot = true;
|
|
39763
|
+
applySnapshot(store, snapshot);
|
|
39764
|
+
};
|
|
39765
|
+
const syncSnapshot = (state) => {
|
|
39766
|
+
const nextSnapshot = toSerializableState(state);
|
|
39767
|
+
getIslandStoreSnapshot()[storeId] = nextSnapshot;
|
|
39768
|
+
for (const peerStore of storeInstances) {
|
|
39769
|
+
if (peerStore.store === store) {
|
|
39770
|
+
continue;
|
|
39771
|
+
}
|
|
39772
|
+
peerStore.applyExternalSnapshot(nextSnapshot);
|
|
39773
|
+
}
|
|
39774
|
+
};
|
|
39775
|
+
storeInstances.add({
|
|
39776
|
+
applyExternalSnapshot,
|
|
39777
|
+
store
|
|
39778
|
+
});
|
|
39779
|
+
stores.set(storeId, storeInstances);
|
|
39780
|
+
syncSnapshot(store.getState());
|
|
39762
39781
|
store.subscribe((state) => {
|
|
39763
|
-
|
|
39782
|
+
if (isApplyingExternalSnapshot) {
|
|
39783
|
+
isApplyingExternalSnapshot = false;
|
|
39784
|
+
return;
|
|
39785
|
+
}
|
|
39786
|
+
syncSnapshot(state);
|
|
39764
39787
|
});
|
|
39765
|
-
stores.set(storeId, store);
|
|
39766
39788
|
return store;
|
|
39767
39789
|
};
|
|
39768
39790
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -39809,5 +39831,5 @@ export {
|
|
|
39809
39831
|
Island
|
|
39810
39832
|
};
|
|
39811
39833
|
|
|
39812
|
-
//# debugId=
|
|
39834
|
+
//# debugId=9C699B2B9235EC6A64756E2164756E21
|
|
39813
39835
|
//# sourceMappingURL=index.js.map
|