Router constructor
Creates a router over patterns. window is injectable for tests.
Implementation
Router(this.patterns, {web.Window? window})
: _window = window ?? web.window,
current = Observable(
matchRoute(patterns, hashToPath((window ?? web.window).location.hash)),
);