Location State Source

Provides a simple way of accessing your current location. Useful when creating isomorphic applications.

var Location = Marty.createStateSource({
  type: 'location'
});
class Location extends Marty.LocationStateSource {
}

getLocation()

Returns information about the current location:

  • url e.g. http://foo.com/bar?baz=bam
  • path e.g. /bar
  • hostname e.g. foo.com
  • query e.g. { baz: 'bam' }
  • protocol e.g. http