location.js 440 B

12345678910111213141516
  1. // window location-related functions in a separate module so they can be mocked/stubbed in tests
  2. export const location = {
  3. assign(url) {
  4. // eslint-disable-next-line no-restricted-syntax
  5. window.location.assign(url)
  6. },
  7. replace(url) {
  8. // eslint-disable-next-line no-restricted-syntax
  9. window.location.replace(url)
  10. },
  11. reload() {
  12. // eslint-disable-next-line no-restricted-syntax
  13. window.location.reload()
  14. },
  15. }