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

flux-router-component

Package Overview
Dependencies
Maintainers
5
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flux-router-component - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

21

lib/RouterMixin.js

@@ -11,5 +11,6 @@ /**

var History = require('./History');
var EVT_CLICK = 'click';
var EVT_PAGELOAD = 'pageload';
var EVT_POPSTATE = 'popstate';
var TYPE_CLICK = 'click';
var TYPE_PAGELOAD = 'pageload';
var TYPE_POPSTATE = 'popstate';
var TYPE_DEFAULT = 'default'; // default value if navigation type is missing, for programmatic navigation
var RouterMixin;

@@ -58,3 +59,3 @@

setImmediate(function navigateToActualRoute() {
context.executeAction(navigateAction, {type: EVT_PAGELOAD, url: urlFromHistory});
context.executeAction(navigateAction, {type: TYPE_PAGELOAD, url: urlFromHistory});
});

@@ -69,3 +70,3 @@ }

if (url !== self.state.route.url) {
context.executeAction(navigateAction, {type: EVT_POPSTATE, url: url, params: (e.state && e.state.params)});
context.executeAction(navigateAction, {type: TYPE_POPSTATE, url: url, params: (e.state && e.state.params)});
}

@@ -107,7 +108,9 @@ }

var nav = newState.route.navigate;
var navType = (nav && nav.type) || TYPE_DEFAULT;
var historyState;
switch (nav.type) {
case EVT_CLICK:
historyState = {params: (nav.params || {})};
switch (navType) {
case TYPE_CLICK:
case TYPE_DEFAULT:
historyState = {params: (nav && nav.params) || {}};
if (this._enableScroll) {

@@ -120,3 +123,3 @@ window.scrollTo(0, 0);

break;
case EVT_POPSTATE:
case TYPE_POPSTATE:
if (this._enableScroll) {

@@ -123,0 +126,0 @@ historyState = (this._history.getState && this._history.getState()) || {};

{
"name": "flux-router-component",
"version": "0.5.3",
"version": "0.5.4",
"description": "Router-related React component and mixin for applications with Flux architecture",

@@ -5,0 +5,0 @@ "main": "index.js",

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