Closed
Description
When using the angular plugin, the dataCallback method I set in the config options is overwritten by the plugin.
Raven.config("mydsn", {
dataCallback: function(data) {
console.log "my data callback was called";
return data;
}
}).install();
The provided callback will be stored in _globalOptions.dataCallback
during config()
. After that, install()
will call angularPlugin
which calls Raven.setDataCallback
- overwriting my callback. There are two solutions here:
- The plugin should create a wrapper method that first calls the already registered callback (if any) and then does it's own work.
- There should not only be one callback but several, registered in an array that will be called one after the other. The downside would be that:
- either the name for registering data callbacks would be called
setDataCallback
although it wouldn't set but add it - or the method would be renamed, breaking backwards compatibility. This could be avoided by keeping
setDataCallback
which would erase all other callbacks and addaddDataCallback
orregisterDataCallback
which would just add the callback to the array.
- either the name for registering data callbacks would be called
I could create a PR if one approach is acceptable.
Metadata
Metadata
Assignees
Labels
No labels