helpers.js (485B)
1 window.updateStateBasedOnTestVariant = (w, state) => { 2 const usp = new URLSearchParams(location.search); 3 const method = usp.get("method"); 4 5 switch (method) { 6 case "navigate": { 7 w.navigation.navigate("#", { history: "replace", state }); 8 break; 9 } 10 case "updateCurrentEntry": { 11 w.navigation.updateCurrentEntry({ state }); 12 break; 13 } 14 default: { 15 assert_unreached(`method must be either "navigate" or "updateCurrentEntry"`); 16 } 17 } 18 };