Add .track() to all events

This commit is contained in:
Richard Ramos 2019-10-03 15:28:29 -04:00
parent 6b1b91274a
commit 4dcc58ca3e
1 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,10 @@ export default class Subspace {
return this.trackEvent(SubspaceContract, eventName, filterConditionsOrCb); return this.trackEvent(SubspaceContract, eventName, filterConditionsOrCb);
} }
Object.keys(SubspaceContract.events).forEach(ev => {
SubspaceContract.events[ev].track = (filterConditionsOrCb) => this.trackEvent(SubspaceContract, ev, filterConditionsOrCb);
});
SubspaceContract.trackProperty = (propName, methodArgs, callArgs) => { SubspaceContract.trackProperty = (propName, methodArgs, callArgs) => {
return this.trackProperty(SubspaceContract, propName, methodArgs, callArgs); return this.trackProperty(SubspaceContract, propName, methodArgs, callArgs);
} }