@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/browser.js
CHANGED
|
@@ -38504,23 +38504,45 @@ var initializeIslandStores = (state) => {
|
|
|
38504
38504
|
};
|
|
38505
38505
|
globalThis.__ABS_ISLAND_STATE__ = nextSnapshot;
|
|
38506
38506
|
for (const [storeId, store] of getIslandStores()) {
|
|
38507
|
-
|
|
38507
|
+
for (const instance of store) {
|
|
38508
|
+
instance.applyExternalSnapshot(nextSnapshot[storeId] ?? {});
|
|
38509
|
+
}
|
|
38508
38510
|
}
|
|
38509
38511
|
};
|
|
38510
|
-
var createIslandStore = (storeId
|
|
38512
|
+
var createIslandStore = (storeId, createState) => {
|
|
38513
|
+
const store = createStore(createState);
|
|
38511
38514
|
const stores = getIslandStores();
|
|
38512
|
-
const
|
|
38513
|
-
if (existingStore) {
|
|
38514
|
-
return existingStore;
|
|
38515
|
-
}
|
|
38516
|
-
const store = createStore()(createState);
|
|
38515
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
38517
38516
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
38518
38517
|
applySnapshot(store, initialSnapshot);
|
|
38519
|
-
|
|
38518
|
+
let isApplyingExternalSnapshot = false;
|
|
38519
|
+
const applyExternalSnapshot = (snapshot) => {
|
|
38520
|
+
isApplyingExternalSnapshot = true;
|
|
38521
|
+
applySnapshot(store, snapshot);
|
|
38522
|
+
};
|
|
38523
|
+
const syncSnapshot = (state) => {
|
|
38524
|
+
const nextSnapshot = toSerializableState(state);
|
|
38525
|
+
getIslandStoreSnapshot()[storeId] = nextSnapshot;
|
|
38526
|
+
for (const peerStore of storeInstances) {
|
|
38527
|
+
if (peerStore.store === store) {
|
|
38528
|
+
continue;
|
|
38529
|
+
}
|
|
38530
|
+
peerStore.applyExternalSnapshot(nextSnapshot);
|
|
38531
|
+
}
|
|
38532
|
+
};
|
|
38533
|
+
storeInstances.add({
|
|
38534
|
+
applyExternalSnapshot,
|
|
38535
|
+
store
|
|
38536
|
+
});
|
|
38537
|
+
stores.set(storeId, storeInstances);
|
|
38538
|
+
syncSnapshot(store.getState());
|
|
38520
38539
|
store.subscribe((state) => {
|
|
38521
|
-
|
|
38540
|
+
if (isApplyingExternalSnapshot) {
|
|
38541
|
+
isApplyingExternalSnapshot = false;
|
|
38542
|
+
return;
|
|
38543
|
+
}
|
|
38544
|
+
syncSnapshot(state);
|
|
38522
38545
|
});
|
|
38523
|
-
stores.set(storeId, store);
|
|
38524
38546
|
return store;
|
|
38525
38547
|
};
|
|
38526
38548
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -38567,5 +38589,5 @@ export {
|
|
|
38567
38589
|
Island
|
|
38568
38590
|
};
|
|
38569
38591
|
|
|
38570
|
-
//# debugId=
|
|
38592
|
+
//# debugId=02F3241D64B3EF6C64756E2164756E21
|
|
38571
38593
|
//# sourceMappingURL=browser.js.map
|