@absolutejs/absolute 0.19.0-beta.337 → 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 -19
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +33 -19
- package/dist/angular/index.js.map +3 -3
- package/dist/client/index.js +33 -19
- package/dist/client/index.js.map +3 -3
- package/dist/islands/browser.js +33 -19
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +33 -19
- package/dist/islands/index.js.map +3 -3
- package/dist/islands/server.js +33 -19
- package/dist/islands/server.js.map +3 -3
- package/dist/react/browser.js +33 -19
- package/dist/react/browser.js.map +3 -3
- package/dist/react/hooks/index.js +33 -19
- package/dist/react/hooks/index.js.map +3 -3
- package/dist/react/index.js +33 -19
- package/dist/react/index.js.map +3 -3
- package/dist/src/client/islandStore.d.ts +7 -5
- package/dist/svelte/browser.js +33 -19
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +33 -19
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/browser.js +33 -19
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +33 -19
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/angular/browser.js
CHANGED
|
@@ -38504,31 +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()((set, get, api) => createState((update) => {
|
|
38517
|
-
set((state) => {
|
|
38518
|
-
const nextPartial = typeof update === "function" ? update(state) : update;
|
|
38519
|
-
return {
|
|
38520
|
-
...state,
|
|
38521
|
-
...nextPartial
|
|
38522
|
-
};
|
|
38523
|
-
});
|
|
38524
|
-
}, get, api));
|
|
38515
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
38525
38516
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
38526
38517
|
applySnapshot(store, initialSnapshot);
|
|
38527
|
-
|
|
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());
|
|
38528
38539
|
store.subscribe((state) => {
|
|
38529
|
-
|
|
38540
|
+
if (isApplyingExternalSnapshot) {
|
|
38541
|
+
isApplyingExternalSnapshot = false;
|
|
38542
|
+
return;
|
|
38543
|
+
}
|
|
38544
|
+
syncSnapshot(state);
|
|
38530
38545
|
});
|
|
38531
|
-
stores.set(storeId, store);
|
|
38532
38546
|
return store;
|
|
38533
38547
|
};
|
|
38534
38548
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -38575,5 +38589,5 @@ export {
|
|
|
38575
38589
|
Island
|
|
38576
38590
|
};
|
|
38577
38591
|
|
|
38578
|
-
//# debugId=
|
|
38592
|
+
//# debugId=02F3241D64B3EF6C64756E2164756E21
|
|
38579
38593
|
//# sourceMappingURL=browser.js.map
|