import { globalObject } from './global-object' ; import { onIdle } from './on-idle' ; let unsubscribe = null ; export const setCurrentHash = ( hash ) => { if ( unsubscribe !== null ) { unsubscribe ( ) ; unsubscribe = null ; } unsubscribe = onIdle ( ( ) => { unsubscribe = null ; globalObject . history . replaceState ( undefined , 'Sandbox' , `#${ hash }` ) ; } ) ; } ;