Utils
Barba is brought to you with a bunch of useful utilities.
barba.version
→ Retrieve the current @barba/core versionbarba.destroy()
→ Destroy the Barba instance and properly removeEventListener
on eligible linksbarba.go(href: string, trigger?: Trigger, e?: LinkEvent | PopStateEvent)
→ Tell Barba to go to a specific URL and play your transitions, if available, without using a browser “force reload”barba.force(href: string)
→ Force Barba to redirect to a specific URL without playing your transitions, equivalent tolocation.href
changebarba.prefetch(href: string)
→ Prefetch the given URL, see prefetch strategybarba.url.parse(url: string)
→ Parse the given URL and retrieve aIUrlBase
barba.history.previous
→ Get the previous history object, see history strategybarba.history.current
→ Get the current history object, see history strategybarba.history.add(url: string, trigger: Trigger, action?: HistoryAction)
→ Push or replace a new state in the browser history, see history strategybarba.cache.get(url: string)
→ Get cache data for a given URL and retrieve action, request, status and target
This is a draft section of @barba/core utilities that shows the most important you could use in your project, check the Developer API for more informations.