riot-route
Advanced tools
Comparing version 2.0.0-beta to 2.0.0-beta.2
@@ -9,5 +9,4 @@ ;(function(riot) { if (!window) return; | ||
var EVT = 'hashchange', win = window, loc = win.location, started = false, fns = riot.observable(), current | ||
var EVT = 'hashchange', win = window, loc = win.location, started = false, fns = observable(), current | ||
/** | ||
@@ -87,3 +86,2 @@ * Get hash part of current URL | ||
riot.route = route })(riot) |
@@ -8,3 +8,3 @@ # Router API | ||
### route(callback) | #route | ||
### route(callback) | ||
@@ -34,3 +34,3 @@ URLハッシュが変更されると、与えられた`callback`を実行します。こんな感じです。 | ||
### route.start() | #route-start | ||
### route.start() | ||
@@ -44,3 +44,3 @@ ウィンドウのハッシュ変更の検知を開始します。これは、Riotが読み込まれた際に自動的に呼び出されます。[route.stop](#route-stop)と合わせて使うのが典型的です。次はその例です。 | ||
### route.stop() | #route-stop | ||
### route.stop() | ||
@@ -55,3 +55,3 @@ ハッシュ変更検知を停止して、[route.route](#route)コールバックもクリアします。 | ||
### route(to) | #route-to | ||
### route(to) | ||
@@ -64,3 +64,3 @@ ブラウザのURLを変更して、`route(callback)`で登録されたすべてのリスナに通知します。例: | ||
### route.exec(callback) | #route-exec | ||
### route.exec(callback) | ||
@@ -75,3 +75,3 @@ 現在のハッシュを調べて、与えられた`callback`をハッシュ変更なしに「その場で」実行します。こんな感じです。 | ||
### route.parser(parser) | #route-parser | ||
### route.parser(parser) | ||
@@ -78,0 +78,0 @@ デフォルトパーサーを独自のものに変更します。これは、こんなパスを解析するための例です。 |
@@ -8,3 +8,3 @@ # Router API | ||
### route(callback) | #route | ||
### route(callback) | ||
@@ -34,3 +34,3 @@ Execute the given `callback` when the URL hash changes. For example | ||
### route.start() | #route-start | ||
### route.start() | ||
@@ -44,3 +44,3 @@ Start listening the window hash changes and it's automatically called when riot gets loaded. You typically use this method together with [route.stop](#route-stop). Example: | ||
### route.stop() | #route-stop | ||
### route.stop() | ||
@@ -55,3 +55,3 @@ Remove the hashchange listeners clearing also the [route.route](#route) callbacks. | ||
### route(to) | #route-to | ||
### route(to) | ||
@@ -64,3 +64,3 @@ Changes the browser URL and notifies all the listeners assigned with `route(callback)`. For example: | ||
### route.exec(callback) | #route-exec | ||
### route.exec(callback) | ||
@@ -75,3 +75,3 @@ Study the current hash "in place" using given `callback` without waiting for it to change. For example | ||
### route.parser(parser) | #route-parser | ||
### route.parser(parser) | ||
@@ -78,0 +78,0 @@ Changes the default parser to a custom one. Here's one that parses paths like this: |
{ | ||
"name": "riot-route", | ||
"version": "2.0.0-beta", | ||
"version": "2.0.0-beta.2", | ||
"description": "Simple client-side router", | ||
@@ -23,3 +23,3 @@ "main": "dist/route.js", | ||
"dependencies": { | ||
"riot-observable": "^2.0.0-beta" | ||
"riot-observable": "^2.0.0-beta.2" | ||
}, | ||
@@ -34,3 +34,4 @@ "devDependencies": { | ||
"karma-mocha": "^0.2.0", | ||
"karma-phantomjs-launcher": "^0.2.1" | ||
"karma-phantomjs-launcher": "^0.2.1", | ||
"uglify-js": "latest" | ||
}, | ||
@@ -37,0 +38,0 @@ "author": "Muut, Inc. and other contributors", |
@@ -27,3 +27,3 @@ [![Build Status][travis-image]][travis-url] | ||
### Npm (not yet published) | ||
### npm | ||
@@ -34,20 +34,8 @@ ```bash | ||
or from GitHub directly: | ||
### Bower | ||
```bash | ||
$ npm install --save riot/route | ||
``` | ||
### Bower (not yet published) | ||
```bash | ||
$ bower install --save riot-route | ||
``` | ||
or from GitHub directly: | ||
```bash | ||
$ bower install --save riot/route | ||
``` | ||
## Demos | ||
@@ -75,5 +63,5 @@ | ||
[coverage-image]:https://img.shields.io/coveralls/riot/route/master.svg?style=flat-square | ||
[coverage-url]:https://coveralls.io/r/riot/route/?branch=master | ||
[coverage-url]:https://coveralls.io/github/riot/route/?branch=master | ||
[codeclimate-image]:https://img.shields.io/codeclimate/github/riot/route.svg?style=flat-square | ||
[codeclimate-url]:https://codeclimate.com/github/riot/route |
@@ -15,3 +15,3 @@ module.exports = function(config) { | ||
'../node_modules/expect.js/index.js', | ||
'../node_modules/riot-observable/index.js', | ||
'../node_modules/riot-observable/dist/observable.js', | ||
'../dist/route.js', | ||
@@ -18,0 +18,0 @@ 'specs/core.specs.js' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
39642
31
9
2
65
2
1