Skip to content

Commit

Permalink
refactor: 'extra' field for future properties
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg authored and 0xpatrickdev committed Jul 1, 2024
1 parent 274df18 commit ff92211
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vow/src/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeAsVow } from './vow-utils.js';

/**
* @import {Zone} from '@agoric/base-zone';
* @import {IsRetryableReason, AsPromiseFunction, Vow, EVow} from './types.js';
* @import {IsRetryableReason, AsPromiseFunction, EVow} from './types.js';
*/

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/vow/src/vow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const { details: X } = assert;
/**
* @import {PromiseKit} from '@endo/promise-kit';
* @import {Zone} from '@agoric/base-zone';
* @import {MapStore} from '@agoric/store';
* @import {VowResolver, VowKit} from './types.js';
*/

Expand Down Expand Up @@ -78,6 +79,12 @@ export const prepareVowKit = zone => {
null
),
isStoredValue: /** @type {boolean} */ (false),
/**
* Map for future properties that aren't in the schema.
* UNTIL https://github.com/Agoric/agoric-sdk/issues/7407
* @type {MapStore<any, any> | undefined}
*/
extra: undefined,
}),
{
vowV0: {
Expand Down
2 changes: 1 addition & 1 deletion packages/vow/src/watch-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { Fail, bare, details: X } = assert;
* @import {Zone} from '@agoric/base-zone';
* @import {Watch} from './watch.js';
* @import {When} from './when.js';
* @import {VowKit, AsPromiseFunction, IsRetryableReason, Vow, EVow} from './types.js';
* @import {VowKit, AsPromiseFunction, IsRetryableReason, EVow} from './types.js';
*/

const VowShape = M.tagged(
Expand Down
1 change: 1 addition & 0 deletions packages/vow/test/watch-utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ test('asPromise handles watcher arguments', async t => {
},
};

// XXX fix type: `watcherContext` doesn't need to be an array
const result = await asPromise(vow, watcher, ['ctx']);
t.is(result, 'watcher test');
t.true(watcherCalled);
Expand Down

0 comments on commit ff92211

Please sign in to comment.