Skip to content

Instantly share code, notes, and snippets.

@mattwelke
Last active July 6, 2018 20:24
Show Gist options
  • Save mattwelke/7a516128ee260ab0d5deb98c3dd7b104 to your computer and use it in GitHub Desktop.
Save mattwelke/7a516128ee260ab0d5deb98c3dd7b104 to your computer and use it in GitHub Desktop.
sdgasedgasegeg
class Parent {
private readonly _child: Child;
constructor() {
// Make a DataDog counter and wrap the child's functions
this._child = new Child();
const dataDogCounter = new DataDogCounter();
}
public doLotsOfStuff() {
// Calls multiple functions of Child.
dataDogCounter.wrap(this._child.doSomeStuff(), /* inject logic how to send messages */ () => { });
dataDogCounter.wrap(this._child.doSomeOtherStuff(), /* inject logic how to send messages */ () => { });
}
}
class Child {
public doSomeStuff() { }
public doSomeOtherStuff() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment