Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-route-pushstate

Package Overview
Dependencies
Maintainers
5
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-route-pushstate - npm Package Compare versions

Comparing version 3.1.2 to 3.2.0

5

can-route-pushstate.js

@@ -31,8 +31,7 @@ // # can/route/pushstate/pushstate.js

if (usePushStateRouting) {
// Registers itself within `route.bindings`.
route.bindings.pushstate = {
/**
* @property {String} route.pushstate.root
* @parent route.pushstate
* @property {String} can-route-pushstate.root root
* @parent can-route-pushstate.static
*

@@ -39,0 +38,0 @@ * @description Configure the base url that will not be modified.

31

can-route-pushstate.md
@module {Object} can-route-pushstate
@parent can-core
@parent can-routing
@collection can-core
@package ./package.json
@group can-route-pushstate.static static

@@ -115,2 +117,29 @@ @description Changes [can-route] to use

### Updating the current route
can-route-pushstate also allows changes to the current route state without creating a new history entry. This behavior can be controlled using the `replaceStateOn`, `replaceStateOff`, and `replaceStateOnce` methods.
Enable the behavior by calling `replaceStateOn` with specified route property keys like:
```js
route.replaceStateOn('page', 'action');
route.attr('page', 'dashboard'); // Route changes, no new history record
```
To return the `attr` call back to normal the `pushstate` behavior, call `replaceStateOff` with the specified route property keys like:
```js
route.replaceStateOff('action');
route.attr('action', 'remove'); // Route changes, new history record is created
```
The behavior can be configured to occur only once for a specific property using `replaceStateOnce` like:
```js
route.replaceStateOnce('page');
route.attr('page', 'dashboard'); // No new history record
route.attr('page', 'search'); // New history record is created
```
## Planning route structure

@@ -117,0 +146,0 @@

{
"name": "can-route-pushstate",
"version": "3.1.2",
"version": "3.2.0",
"description": "Pushstate for can-route",

@@ -5,0 +5,0 @@ "homepage": "https://canjs.com",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc