3.2.4 • Published 2 years ago

presentation-router v3.2.4

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
2 years ago

presentation-router

Augmented.js Presentation Router Module

API

Table of Contents

Router

Extends AugmentedObject

Routers map faux-URLs to actions, and fire events when routes are matched. Creating a new one sets its routes hash, if not set statically. Supports passing routes to the constructor as well as a transition flag.

Parameters

  • options

Examples

const router = new Router({
   "routes": { ... },
   "transition": { "in": #, "out": # }
});

view

Properties

  • view Presentation.View Read only property to current view

loadView

Load a view safely and remove the last view by calling cleanup, then remove

Parameters

  • view View The View to load

cleanup

Remove the last view by calling cleanup, then removes

Parameters

  • oldView

initialize

Initialize is an empty function by default. Override it with your own initialization logic.

Parameters

  • options

route

Manually bind a single named route to a callback.

Parameters

Examples

this.route('search/:query/p:num', 'search', (query, num) => {
  ...
});

execute

Execute a route handler with the provided parameters. This is an excellent place to do pre-route setup or post-route cleanup.

Parameters

navigate

Simple proxy to history to save a fragment into the history.

Parameters

  • fragment string route fragment
  • options object any options to pass

startHistory

Start the history using browser History API

Parameters

  • options object any options to pass

parseQuery

Parse a query string and return as an object

Parameters

Returns object Object of the query params

History

Extends AugmentedObject

Handles cross-browser history management, based on either pushState and real URLs, or onhashchange and URL fragments.

Parameters

  • options

serialize

Serialize object into query parameters url string

Parameters

  • obj object Object to serialize

Returns string URL string

3.2.4

2 years ago

3.2.3

2 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.6.7

5 years ago

2.6.6

5 years ago

2.6.5

5 years ago

2.6.4

6 years ago

2.6.3

6 years ago

2.6.2

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.3

6 years ago

2.5.2

6 years ago