links
links copied to clipboard
Redirect command in MVU
It's often the case that we want to change page as a result of, say, clicking a button in an MVU application. Currently we just use redirect directly as Links is impure, but this isn't a particularly idiomatic way of doing things and has led to a weird race condition in a student project.
This patch introduces a Redirect command, which can be accessed through MvuCommands.changePage(url). The redirect is then processed in the MVU event loop as would be expected.
Thanks @dhil. Agreed in general — although since this is in MVU it will run on the client and therefore use the jslib implementation of redirect (which I think uses document.url to perform the redirect).