Skip to content

Commit

Permalink
Revert "fix: correct placement for podium global"
Browse files Browse the repository at this point in the history
This reverts commit 154d5ca.
  • Loading branch information
tor0405 committed Jun 11, 2024
1 parent 9e14996 commit 2a36721
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,5 @@ export class PodiumBridge {
}
}

globalThis.window['@podium'] = globalThis.window['@podium'] || {};
globalThis.window['@podium'].bridge = new PodiumBridge();
globalThis['@podium'] = globalThis['@podium'] || {};
globalThis['@podium'].bridge = new PodiumBridge();
8 changes: 4 additions & 4 deletions tests/bridge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test('psedurandom fallback generates a unique string', () => {

test('invokes a registered listener when a message is received', (t, done) => {
assert.ok(
globalThis.window['@podium'].bridge,
globalThis['@podium'].bridge,
'Expected to find the Podium bridge on globalThis',
);

Expand All @@ -47,7 +47,7 @@ test('invokes a registered listener when a message is received', (t, done) => {
};

/** @type {import("../lib/bridge.js").PodiumBridge} */
const bridge = globalThis.window['@podium'].bridge;
const bridge = globalThis['@podium'].bridge;
bridge.on('foo/bar', (message) => {
const request =
/** @type {import("../lib/bridge.js").RpcRequest<string[]>} */ (message);
Expand All @@ -64,12 +64,12 @@ test('invokes a registered listener when a message is received', (t, done) => {

test('unsubscribe should remove subscribed listener', () => {
assert.ok(
globalThis.window['@podium'].bridge,
globalThis['@podium'].bridge,
'Expected to find the Podium bridge on globalThis',
);

/** @type {import("../lib/bridge.js").PodiumBridge} */
const bridge = globalThis.window['@podium'].bridge;
const bridge = globalThis['@podium'].bridge;

let counter = 0;
/** @type {import("../lib/bridge.js").EventHandler<unknown>} */
Expand Down

0 comments on commit 2a36721

Please sign in to comment.