Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Feb 26, 2017
1 parent 38f02c6 commit 925cd74
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
[![Build Status](https://travis-ci.org/TitanNanoDE/af-router.svg?branch=master)](https://travis-ci.org/TitanNanoDE/af-router)
[![Coverage Status](https://coveralls.io/repos/github/TitanNanoDE/af-router/badge.svg?branch=master)](https://coveralls.io/github/TitanNanoDE/af-router?branch=master)

## Instalation
AF Router is a single page application router. It allows to easily attach
listeners to state changes.

## Installation

```
npm i --save @af-modules/router
Expand All @@ -29,4 +32,21 @@ Router.init([

]);

Router.restore();
```

## API

```JavaScript
Router.init([{ path: string, onEnter: Function, onLeave: Function, isPersistent: boolean }]);
```

The `init()` method initializes the router. An array of objects can be specified to define the initial states.


```JavaScript
Router.restore();
```

Restores the state of the application the last time it was open. Call this method
if users should be able to return to the application in the same state they left.
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@af-modules/router",
"version": "0.1.0",
"description": "A single page web app router",
"description": "A single page web application router",
"main": "main.js",
"scripts": {
"build": "gulp --gulpfile .travis/Gulpfile.js --cwd ./",
Expand All @@ -12,7 +12,9 @@
"coveralls": "npm run remap-cov && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"keywords": [
"application-frame"
"application-frame",
"af-module",
"router"
],
"author": "Jovan Gerodetti (TitanNano)",
"license": "Apache-2.0",
Expand All @@ -30,5 +32,13 @@
"merge-stream": "^1.0.1",
"mocha": "^3.2.0",
"remap-istanbul": "^0.9.1"
},
"bugs": {
"url": "https://github.com/TitanNanoDE/af-router/issues"
},
"homepage": "https://github.com/TitanNanoDE/af-router#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/TitanNanoDE/af-router.git"
}
}

0 comments on commit 925cd74

Please sign in to comment.