Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Interfaces

Functions

Functions

goto

  • Progammatically navigates the Browser to the given href, and pushes a new History state

    NOTE: If your <head> element contains a <base> element, goto will read it as the base url

    As a simple example:

    import {goto} from "svelte-commons/lib/util/browser";
    
    // Navigate to a page decending from the current origin
    goto("/shopping-cart/item-274");
    
    // Similar to above, by updates the Browser's hash string instead
    goto("/shopping-cart/item-274", {hash: true});

    You can also replace the current History state:

    import {goto} from "svelte-commons/lib/util/browser";
    
    // Same above, but replacing current History state
    goto("/shopping-cart/item-274", {replace: true});

    Finally, you can navigate to entirely different websites:

    import {goto} from "svelte-commons/lib/util/browser";
    
    // This will cause a full page reload while navigating
    goto("https://google.com");

    Parameters

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc