API
addRoute()
Registers a route into the RouteStore.
navigateTo()
Perform a manual navigation to the provided URL.
If a transition
name is not provided then Taxi will try and find a match in the RouteStore, otherwise the default transition will be used.
preload()
Prefetch the provided URL and add it to the cache ahead of any user navigation.
You can pass a second argument to indicate you want to preload the assets on the target URL as well (images, media, etc):
As preload
returns a promise, you can also run code based on whether the fetch was a success or not:
updateCache()
Updates the cached HTML for the provided URL. If no URL is provided, update cache for the current URL.
Useful when adding/removing content via AJAX such as a search page or infinite scroll.
clearCache()
Remove the cached HTML for the provided URL. If no URL is provided, remove cache for the current URL.
setDefaultRenderer()
If you don't like "default" as the name of your default renderer, you can change the default renderer to be anything you like here.
setDefaultTransition()
Same as setDefaultRenderer
, but for the transitions instead.
Events
Events are handled by @unseenco/e.
Adding Listeners
Removing Listeners
You can call taxi.off(event_name)
to remove all listeners for an event, or pass the callback to remove just that listener instead: