Skip to content

Commit

Permalink
chore: do remaining.delete in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed May 12, 2023
1 parent 4ba0031 commit ec7cea6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vats/src/core/promise-space.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const makePromiseSpace = (optsOrLog = {}) => {
const pk = makePromiseKit();
pk.promise
.finally(() => {
remaining.delete(name);
onSettled(name, remaining);
})
.catch(() => {});
Expand All @@ -131,13 +132,11 @@ export const makePromiseSpace = (optsOrLog = {}) => {
const old = provideState(name);
nameToState.set(name, harden({ ...old, isSettling: true }));
old.pk.resolve(value);
remaining.delete(name);
};
const reject = reason => {
const old = provideState(name);
nameToState.set(name, harden({ ...old, isSettling: true }));
old.pk.reject(reason);
remaining.delete(name);
};
const reset = (reason = undefined) => {
onReset(name);
Expand Down

0 comments on commit ec7cea6

Please sign in to comment.