web-portals
Version:
web-portals
21 lines (19 loc) • 454 B
text/typescript
import { Application } from './index'
export default (app: Application) => {
window.addEventListener('message', (event: MessageEvent) => {
const { data } = event
const { action } = data
switch (action) {
case 'to':
app.transform.to(data.module, data.query, data.history)
break
case 'back':
history.back()
break
case 'forward':
history.forward()
break
}
})
return
}