Skip to content

Commit

Permalink
Merge pull request #70 from yojeek/fix-default-plugin
Browse files Browse the repository at this point in the history
Do not share default plugin between OSC class instances.
  • Loading branch information
adzialocha authored Jun 18, 2023
2 parents a6a102b + 0f0a8a1 commit fafadf2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/osc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Plugin from './plugin/plugin'
*/
const defaultOptions = {
discardLateMessages: false,
plugin: new WebsocketClientPlugin(),
}

/**
Expand Down Expand Up @@ -88,6 +87,10 @@ class OSC {
* @private
*/
this.options = { ...defaultOptions, ...options }
// create default plugin with default options
if (!this.options.plugin) {
this.options.plugin = new WebsocketClientPlugin();
}
/**
* @type {EventHandler} eventHandler
* @private
Expand Down

0 comments on commit fafadf2

Please sign in to comment.