cyclic-router
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -0,1 +1,10 @@ | ||
# v3.0.1 (2016-09-28) | ||
## Bug Fixes | ||
- **typings:** update typings to use RouteDefinitionsMap and RouteMatcherReturn (#141) | ||
([08f9db47](https://github.com/git+https://github.com/TylorS/cyclic-router.git/commits/08f9db47c2c69afd90e4e366e428ad892e8fe258)) | ||
# v2.1.2 (2016-07-02) | ||
@@ -2,0 +11,0 @@ |
import {Stream} from 'most'; | ||
import {Pathname, Location} from '@cycle/history/lib/interfaces'; | ||
import {RouteDefinitions, SwitchPathReturn} from './lib/interfaces'; | ||
import {RouteDefinitionsMap, RouteMatcherReturn} from './lib/interfaces'; | ||
export interface RouterSource { | ||
history$: Stream<Location>; | ||
path(pathname: Pathname): RouterSource; | ||
define(routes: RouteDefinitions): Stream<SwitchPathReturn>; | ||
define(routes: RouteDefinitionsMap): Stream<RouteMatcherReturn>; | ||
createHref(path: Pathname): Pathname; | ||
} |
{ | ||
"name": "cyclic-router", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A router driver built for Cycle.js", | ||
@@ -22,4 +22,3 @@ "main": "lib/index.js", | ||
"@cycle/history": "^4.0.0", | ||
"history": "^3.0.0", | ||
"switch-path": "^1.1.7" | ||
"history": "^3.0.0" | ||
}, | ||
@@ -44,7 +43,8 @@ "devDependencies": { | ||
"tslint": "^3.10.2", | ||
"typescript": "^1.8.10", | ||
"typescript": "^2.0.3", | ||
"typings": "^0.8.1", | ||
"uglify-js": "^2.7.1", | ||
"validate-commit-message": "^3.0.1", | ||
"xstream": "^5.0.6" | ||
"xstream": "^5.0.6", | ||
"switch-path": "^1.1.8" | ||
}, | ||
@@ -51,0 +51,0 @@ "config": { |
# cyclic-router | ||
cyclic-router is a Router Driver built for Cycle.js | ||
**Disclaimer** v2.x.x is for Cycle Diversity! | ||
**Disclaimer** v2.x.x and v3 are for Cycle Diversity! | ||
If you are still using @cycle/core please continue to use v1.x.x | ||
@@ -11,4 +11,11 @@ | ||
$ npm install cyclic-router | ||
$ npm install --save cyclic-router | ||
Version 3 requires users to inject the route matcher. We'll use `switch-path` for our examples but other | ||
matching libraries could be adapted to be used here: | ||
$ npm install --save switch-path | ||
Note: Version 2 and below use `switch-path` for the route matcher always and the above library install is not necesssary/done implicitly. | ||
Then with a module bundler like [browserify](http://browserify.org/), use as you would anything else: | ||
@@ -26,3 +33,3 @@ | ||
For API documentation pleave visit this link [here](http://cyclejs-community.github.io/cyclic-router/docs/) | ||
For API documentation please visit this link [here](http://cyclejs-community.github.io/cyclic-router/docs/) | ||
@@ -37,2 +44,3 @@ ## Basic Usage | ||
import {createHistory} from 'history'; | ||
import switchPath from 'switch-path'; // Required in v3, not required in v2 or below | ||
@@ -59,3 +67,4 @@ function main(sources) { | ||
DOM: makeDOMDriver('#app'), | ||
router: makeRouterDriver(createHistory()) | ||
router: makeRouterDriver(createHistory(), switchPath) // v3 | ||
// router: makeRouterDriver(createHistory()) // <= v2 | ||
}); | ||
@@ -66,3 +75,3 @@ ``` | ||
You can pass route parameters to your component by adding them to the component sources. | ||
This behavior changes based on the injected route matcher. In the case of `switch-path`, you can pass route parameters to your component by adding them to the component sources. | ||
@@ -69,0 +78,0 @@ ```js |
import {Observable} from 'rx'; | ||
import {Pathname, Location} from '@cycle/history/lib/interfaces'; | ||
import {RouteDefinitions, SwitchPathReturn} from './lib/interfaces'; | ||
import {RouteDefinitionsMap, RouteMatcherReturn} from './lib/interfaces'; | ||
export interface RouterSource { | ||
history$: Observable<Location>; | ||
path(pathname: Pathname): RouterSource; | ||
define(routes: RouteDefinitions): Observable<SwitchPathReturn>; | ||
define(routes: RouteDefinitionsMap): Observable<RouteMatcherReturn>; | ||
createHref(path: Pathname): Pathname; | ||
} |
import {Observable} from 'rxjs'; | ||
import {Pathname, Location} from '@cycle/history/lib/interfaces'; | ||
import {RouteDefinitions, SwitchPathReturn} from './lib/interfaces'; | ||
import {RouteDefinitionsMap, RouteMatcherReturn} from './lib/interfaces'; | ||
export interface RouterSource { | ||
history$: Observable<Location>; | ||
path(pathname: Pathname): RouterSource; | ||
define(routes: RouteDefinitions): Observable<SwitchPathReturn>; | ||
define(routes: RouteDefinitionsMap): Observable<RouteMatcherReturn>; | ||
createHref(path: Pathname): Pathname; | ||
} |
import {Stream} from 'xstream'; | ||
import {Pathname} from '@cycle/history/lib/interfaces'; | ||
import {RouteDefinitions, SwitchPathReturn} from './lib/interfaces'; | ||
import {RouteDefinitionsMap, RouteMatcherReturn} from './lib/interfaces'; | ||
export interface RouterSource { | ||
history$: Stream<Location>; | ||
path(pathname: Pathname): RouterSource; | ||
define(routes: RouteDefinitions): Stream<SwitchPathReturn>; | ||
define(routes: RouteDefinitionsMap): Stream<RouteMatcherReturn>; | ||
createHref(path: Pathname): Pathname; | ||
} |
927733
2
113
23
- Removedswitch-path@^1.1.7
- Removedswitch-path@1.2.0(transitive)