Skip to content

Commit

Permalink
🔧 Adding the optional parameters attribute to the query function (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
papoms authored and WilliamDASILVA committed Mar 1, 2019
1 parent ffdc45f commit f2adf96
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/templates/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,26 @@ class Fb {
/**
* @method track
*/
track (event = null) {
track (event = null, parameters = null) {
if (!event) {
event = this.options.track
}

this.query('track', event)
this.query('track', event, parameters)
}

/**
* @method query
* @param {string} cmd
* @param {object} option
* @param {object} parameters
*/
query (cmd, option) {
this.fbq(cmd, option)
query (cmd, option, parameters = null) {
if (!parameters) {
this.fbq(cmd, option)
} else {
this.fbq(cmd, option, parameters)
}
}
}

Expand Down

0 comments on commit f2adf96

Please sign in to comment.