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 URLbarba.url.parse(url: string)
→ Parse the given URL and retrieve aIUrlBase
barba.history.previous
→ Get the previous historyIStateItem
object, with URL, namespace and scroll x/y positionsbarba.history.add(url: string, trigger: Trigger)
→ Add a new state in the browser history, allowing you to add “sub-URL” in the same page
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.