the-killer-router
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -5,2 +5,6 @@ import Routes from './routes'; | ||
constructor() { | ||
this.route = {}; | ||
} | ||
reactComponent(reactComponent) { | ||
@@ -23,3 +27,5 @@ this._reactComponent = reactComponent; | ||
navigate(path, data, title) { | ||
this.component = this.evaluteRoute(path); | ||
const {view, config} = this.evaluteRoute(path); | ||
this.component = view; | ||
this.activeRouteConfig = { config, data }; | ||
history.pushState(null, title, path); | ||
@@ -26,0 +32,0 @@ this._reactComponent && this._reactComponent.forceUpdate(); |
class Routes { | ||
add(path, execution) { | ||
add(path, view, config) { | ||
this[path] = {}; | ||
if (!arguments.length) return this; | ||
this[path] = execution; | ||
this[path].view = view; | ||
this[path].config = config; | ||
return this; | ||
@@ -6,0 +8,0 @@ } |
{ | ||
"name": "the-killer-router", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "A router library for a view frameworks based", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4298
65