Webapi with hub-cleapup assistence pattern
any of the index key should be registerForCleanup. i.e. any of indexXxx should follow the registerForCleanup.
clean the indexed key which indexed by the host component in beforeUnmount. And so that the component doesn't clean the key that doesn't create by the component itself.
Although cleanupHub clean them for sure, the code demonstrates example of pure web-api cleanup (So that it can be a complete web-api workflow).
Notice
- before current key modified, the previous key should be called this.cleanupKey.
- A twin key should be made from the outside key to keep the lifecycle maintained.