Last active
July 6, 2018 20:24
-
-
Save mattwelke/7a516128ee260ab0d5deb98c3dd7b104 to your computer and use it in GitHub Desktop.
sdgasedgasegeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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