Novices Plagiarizing Mozart
Miss any of our Open RFC calls?Watch the recordings here! »

speclate-router

9.0.0 • Public • Published

speclate-router

Greenkeeper badge

Client side router for speclate.

Given a speclate spec (github.com/simonmcmanus/speclate) Generates a page.js router:

Example

var router = require('speclate-router');
var spec = {
    '/': {
        page: 'home'
    }
};
 
router(spec, {
  before: function () {
      // before the page change.
  },
  after: function () {
      // after the page change.
    $('html,body').scrollTop($('#container'))
  },
  error: function (err) {
      location.reload()
  }
});
 

Notes

  • / gets replaces for /index.html

For an example see:

https://github.com/lnug/lnug.github.io/blob/master/client/index.js

Keywords

none

Install

npm i speclate-router

DownloadsWeekly Downloads

9

Version

9.0.0

License

ISC

Unpacked Size

81.1 MB

Total Files

28

Last publish

Collaborators

  • avatar