Skip to content

Commit

Permalink
fix: Allow SDKs to pass in the entire initialize call
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed Aug 24, 2023
1 parent fc72fc1 commit 2163738
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions languages/javascript/src/shared/Transport/index.mjs
Expand Up @@ -29,10 +29,10 @@ let moduleInstance = null
const isEventSuccess = x => x && (typeof x.event === 'string') && (typeof x.listening === 'boolean')

const win = typeof window !== 'undefined' ? window : {}
let version
let initMessage

export function initialize(v) {
version = v
export function initialize(module, method, params) {
initMessage = { module, method, params }
}

export default class Transport {
Expand Down Expand Up @@ -152,10 +152,10 @@ export default class Transport {

_processRequest (module, method, params, transforms) {

if (version) {
const v = version
version = null
Transport.send("Internal", "initialize", { version: v })
if (initMessage) {
const init = initMessage
initMessage = null
Transport.send(init.module, init.method, init.params)
}

const p = this._addPromiseToQueue(module, method, params, transforms)
Expand Down

0 comments on commit 2163738

Please sign in to comment.