Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 4x 4x 413x | import { Hub } from '../../RuneHub'
/**
* Gets the currently active hub.
* Returns the current hub if one is active, otherwise returns the root hub.
* @returns The current or root hub instance
* @example
* ```ts
* const customHub = new Hub()
*
* customHub.use(() => {
* console.log(hub() === customHub)
* // true
* })
* ```
*/
export function hub () {
return Hub.cur ?? Hub.root
}
|