Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirShintel committed Nov 4, 2024
1 parent 874082f commit 46ffc11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/appHost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function createAppHost(initialEntryPointsOrPackages: EntryPointOrPackage[
let isInstallingEntryPoints: boolean = false
let isStoreSubscribersNotifyInProgress = false
let isObserversNotifyInProgress = false
let isDeferringNotifications = false
let shouldFlushMemoizationSync = false
const entryPointsInstallationEndCallbacks: Map<string, () => void> = new Map()

verifyLayersUniqueness(options.layers)
Expand Down Expand Up @@ -667,8 +667,8 @@ miss: ${memoizedWithMissHit.miss}
notifyObserversIsRunning => {
isObserversNotifyInProgress = notifyObserversIsRunning
},
deferNotifications => {
isDeferringNotifications = deferNotifications
updateShouldFlushMemoizationSync => {
shouldFlushMemoizationSync = updateShouldFlushMemoizationSync
}
)
store.subscribe(() => {
Expand All @@ -679,7 +679,7 @@ miss: ${memoizedWithMissHit.miss}
})
store.syncSubscribe(() => {
shouldFlushMemoization = true
if (isStoreSubscribersNotifyInProgress || isObserversNotifyInProgress || isDeferringNotifications) {
if (isStoreSubscribersNotifyInProgress || isObserversNotifyInProgress || shouldFlushMemoizationSync) {
shouldFlushMemoization = false
flushMemoizedForState()
}
Expand Down
6 changes: 3 additions & 3 deletions src/throttledStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const createThrottledStore = (
cancelAnimationFrame: Window['cancelAnimationFrame'],
updateIsSubscriptionNotifyInProgress: (isSubscriptionNotifyInProgress: boolean) => void,
updateIsObserversNotifyInProgress: (isObserversNotifyInProgress: boolean) => void,
updateIsDeferringNotifications: (isDeferringNotifications: boolean) => void
updateShouldFlushMemoizationSync: (shouldFlushMemoizationSync: boolean) => void
): PrivateThrottledStore => {
let pendingBroadcastNotification = false
let pendingObservableNotifications: Set<AnyPrivateObservableState> | undefined
Expand Down Expand Up @@ -287,12 +287,12 @@ export const createThrottledStore = (
try {
executePendingActions()
isDeferrringNotifications = true
shouldClearMemoizedForState && updateIsDeferringNotifications(isDeferrringNotifications)
shouldClearMemoizedForState && updateShouldFlushMemoizationSync(isDeferrringNotifications)
const functionResult = await action()
return functionResult
} finally {
isDeferrringNotifications = false
shouldClearMemoizedForState && updateIsDeferringNotifications(isDeferrringNotifications)
shouldClearMemoizedForState && updateShouldFlushMemoizationSync(isDeferrringNotifications)
executePendingActions()
}
}
Expand Down

0 comments on commit 46ffc11

Please sign in to comment.