title: TypeScript: OnExit decorator
body: <p>Intro:</p>
  
  <p>I have the following structure:
  <code>Item</code> object that contains array of <code>Group(s)</code> and every group contains array of <code>User(s)</code>.
  <code>Item</code> has the following API:
  <code>addUser</code>, <code>removeUser</code>, <code>addGroup</code>, <code>removeGroup</code>, <code>addUnit</code> and <code>removeUnit</code>.
  Each of those action triggers a new calculation of the <code>rank</code> property of each user (for a certain group).</p>
  
  <p>I am looking for a way that in the end of each of API's actions the method <code>calcRank</code> will be triggered without calling it explicitly (something like OnExit decorator).</p>