-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
setDataCallbackalthough it wouldn't set but add it - or the method would be renamed, breaking backwards compatibility. This could be avoided by keeping
setDataCallbackwhich would erase all other callbacks and addaddDataCallbackorregisterDataCallbackwhich 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