import Context from '../context/Context' ; export default function createContextStack < C extends Context > ( ) { const contextStack = [ ] ; return { push ( context ) { contextStack . push ( context ) ; } , pop ( ) { contextStack . pop ( ) ; } , getCurrent ( ) { return contextStack [ contextStack . length - 1 ] ; } , } ; }