can-route
Advanced tools
Comparing version 4.0.0-pre.12 to 4.0.0-pre.13
@@ -6,3 +6,3 @@ /*jshint -W079 */ | ||
var namespace = require('can-namespace'); | ||
var devLog = require('can-log/dev/dev'); | ||
var each = require('can-util/js/each/each'); | ||
@@ -13,3 +13,2 @@ var isFunction = require('can-util/js/is-function/is-function'); | ||
var assign = require("can-util/js/assign/assign"); | ||
var dev = require('can-util/js/dev/dev'); | ||
var canReflect = require('can-reflect'); | ||
@@ -84,3 +83,3 @@ var canSymbol = require('can-symbol'); | ||
// updateRouteData is called typically by hashchange which fires asynchronously | ||
// So it's possible that someone started changing the data before the | ||
// So it’s possible that someone started changing the data before the | ||
// hashchange event fired. For this reason, it will not set the route data | ||
@@ -160,3 +159,3 @@ // if the data is changing or the hash already matches the hash that was set. | ||
//!steal-remove-start | ||
dev.warn('Set route.data directly instead of calling route.map'); | ||
devLog.warn('Set route.data directly instead of calling route.map'); | ||
//!steal-remove-end | ||
@@ -167,4 +166,5 @@ canRoute.data = data; | ||
/** | ||
* @function can-route.ready ready | ||
* @function can-route.start start | ||
* @parent can-route.static | ||
* @release 3.3 | ||
* | ||
@@ -199,9 +199,3 @@ * Initializes can-route. | ||
*/ | ||
ready: function (val) { | ||
//!steal-remove-start | ||
dev.warn("Use can-route.start() instead of can-route.ready()"); | ||
//!steal-remove-end | ||
canRoute.start(); | ||
}, | ||
start: function(val){ | ||
start: function (val) { | ||
if (val !== true) { | ||
@@ -288,3 +282,3 @@ canRoute._setup(); | ||
each(['addEventListener','removeEventListener','bind', 'unbind', 'on', 'off'], function(name) { | ||
// exposing all internal eventQueue evt's to canRoute | ||
// exposing all internal eventQueue evt’s to canRoute | ||
canRoute[name] = function(eventName, handler) { | ||
@@ -392,3 +386,3 @@ if (eventName === '__url') { | ||
} | ||
// if it's a map, we make it always set strings for backwards compat | ||
// if it’s a map, we make it always set strings for backwards compat | ||
if( "attr" in data ) { | ||
@@ -395,0 +389,0 @@ setRouteData( stringCoercingMapDecorator(data) ); |
@@ -22,3 +22,3 @@ @function can-route can-route | ||
@param {String} template the fragment identifier to match. The fragment identifier should contain characters (a-Z), optionally wrapped in braces ( { } ). Identifiers wrapped in braces are interpreted as being properties on can-route's map. Examples: | ||
@param {String} template the fragment identifier to match. The fragment identifier should contain characters (a-Z), optionally wrapped in braces ( { } ). Identifiers wrapped in braces are interpreted as being properties on can-route’s map. Examples: | ||
@@ -30,3 +30,3 @@ ```js | ||
@param {Object} [defaults] An object of default values. These defaults are applied to can-route's map when the route is matched. | ||
@param {Object} [defaults] An object of default values. These defaults are applied to can-route’s map when the route is matched. | ||
@@ -41,7 +41,7 @@ @return {can-route} | ||
To support the browser's back button and bookmarking in a JavaScript | ||
To support the browser’s back button and bookmarking in a JavaScript | ||
application, most applications use | ||
the `window.location.hash`. By | ||
changing the hash (via a link or JavaScript), | ||
one is able to add to the browser's history | ||
one is able to add to the browser’s history | ||
without changing the page. | ||
@@ -99,3 +99,3 @@ | ||
Listen to changes in history by [can-event.addEventListener listening] to | ||
changes of can-route's `matched` compute: | ||
changes of can-route’s `matched` compute: | ||
@@ -154,3 +154,3 @@ ```js | ||
route. A route is a mapping from a url to | ||
an object (that is the route's state). | ||
an object (that is the route’s state). | ||
In order to map to a specific properties in the url, | ||
@@ -164,3 +164,3 @@ prepend a colon to the name of the property like: | ||
If no routes are added, or no route is matched, | ||
can-route's data is updated with the [can-route.deparam deparamed] | ||
can-route’s data is updated with the [can-route.deparam deparamed] | ||
hash. | ||
@@ -175,3 +175,3 @@ | ||
can-route looks for matching routes and uses them | ||
to update can-route's data. | ||
to update can-route’s data. | ||
@@ -206,4 +206,4 @@ ```js | ||
After your application has created all of its routes, call [can-route.ready] | ||
to set can-route's data to match the current hash: | ||
After your application has created all of its routes, call [can-route.start] | ||
to set can-route’s data to match the current hash: | ||
@@ -216,3 +216,3 @@ ```js | ||
Typically, you don't set `location.hash` | ||
Typically, you don’t set `location.hash` | ||
directly. Instead, you can change properties on can-route | ||
@@ -219,0 +219,0 @@ like: |
{ | ||
"name": "can-route", | ||
"version": "4.0.0-pre.12", | ||
"version": "4.0.0-pre.13", | ||
"description": "Observable front-end application routing for CanJS.", | ||
@@ -38,2 +38,3 @@ "homepage": "https://canjs.com/doc/can-route.html", | ||
"can-event-queue": "<2.0.0", | ||
"can-log": "<2.0.0", | ||
"can-namespace": "1.0.0", | ||
@@ -40,0 +41,0 @@ "can-observation": "^4.0.0-pre.21", |
@@ -10,3 +10,3 @@ @function can-route.data data | ||
One of the biggest challenges in a complex application is getting all the different parts of the app to talk to each other simply, cleanly, and reliably. | ||
One of the biggest challenges in a complex application is getting all the different parts of the app to talk to each other simply, cleanly, and reliably. | ||
@@ -99,3 +99,3 @@ An elegant way to solve this problem is using the [Observer Pattern](http://en.wikipedia.org/wiki/Observer_pattern). A single object, which can be called [Application ViewModel](https://www.youtube.com/watch?v=LrzK4exG5Ss), holds the high level state of the application. | ||
}, | ||
// toggle selected from a comma separated list of ids | ||
@@ -131,3 +131,3 @@ set: function(val){ | ||
// call ready after the AppViewModel is fully initialized | ||
// call start after the AppViewModel is fully initialized | ||
route.start(); | ||
@@ -134,0 +134,0 @@ }); |
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
31
98136
14
2468
+ Addedcan-log@<2.0.0