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

@ngrx/router-store

Package Overview
Dependencies
Maintainers
3
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngrx/router-store - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

src/reducer.metadata.json

2

bundles/router-store.min.umd.js

@@ -1,1 +0,1 @@

!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@ngrx/store"),require("rxjs/operator/filter"),require("rxjs/operator/map"),require("rxjs/operator/withLatestFrom"),require("@ngrx/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/router","@ngrx/store","rxjs/operator/filter","rxjs/operator/map","rxjs/operator/withLatestFrom","@ngrx/core"],factory):factory((global.ngrx=global.ngrx||{},global.ngrx.routerStore=global.ngrx.routerStore||{}),global.ng.core,global.ng.common,global.ng.router,global.ngrx.store,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.ngrx.core)}(this,function(exports,_angular_core,_angular_common,_angular_router,_ngrx_store,rxjs_operator_filter,rxjs_operator_map,rxjs_operator_withLatestFrom,_ngrx_core){"use strict";function go(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.GO,payload:payload}}function replace(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.REPLACE,payload:payload}}function search(query,extras){var payload={query:query,extras:extras};return{type:routerActions.SEARCH,payload:payload}}function show(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.SHOW,payload:payload}}function back(){var payload={};return{type:routerActions.BACK,payload:payload}}function forward(){var payload={};return{type:routerActions.FORWARD,payload:payload}}function routerReducer(state,action){switch(void 0===state&&(state=null),action.type){case routerActions.UPDATE_LOCATION:return action.payload;default:return state}}function listenForRouterMethodActions(router,location,actions$){rxjs_operator_filter.filter.call(actions$,function(action){return routerActionTypes.indexOf(action.type)>-1}).subscribe(function(action){var _a=action.payload,path=_a.path,queryParams=_a.query,_b=_a.extras,extras=void 0===_b?{}:_b,commands=Array.isArray(path)?path:[path];switch(action.type){case routerActions.GO:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams}));break;case routerActions.REPLACE:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams,replaceUrl:!0}));break;case routerActions.SEARCH:var urlTree=router.parseUrl(router.url);urlTree.queryParams=queryParams,router.navigateByUrl(urlTree,extras);break;case routerActions.SHOW:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams,skipLocationChange:!0}));break;case routerActions.BACK:location.back();break;case routerActions.FORWARD:location.forward()}})}function selectRouter(store){return _ngrx_core.select.call(store,function(state){return state.router})}function getLatestUrl(router){var navigationEnd$=rxjs_operator_filter.filter.call(router.events,function(event){return event instanceof _angular_router.NavigationEnd}),navigationEndUrl$=_ngrx_core.select.call(navigationEnd$,function(){return router.url});return navigationEndUrl$}function connectRouterActions(router,store){var routerAndStore$=rxjs_operator_withLatestFrom.withLatestFrom.call(getLatestUrl(router),selectRouter(store)),mismatchUrl$=rxjs_operator_filter.filter.call(routerAndStore$,function(_a){var url=_a[0],rs=_a[1];return rs&&rs.path!==url||!rs}),updateLocation$=rxjs_operator_map.map.call(mismatchUrl$,function(_a){var path=_a[0];return{type:routerActions.UPDATE_LOCATION,payload:{path:path}}});updateLocation$.subscribe(store)}function listenForStoreChanges(router,store){var storeAndRouter$=rxjs_operator_withLatestFrom.withLatestFrom.call(selectRouter(store),getLatestUrl(router)),mismatch$=rxjs_operator_filter.filter.call(storeAndRouter$,function(_a){var rs=_a[0],url=_a[1];return rs.path!==url}),newPath$=rxjs_operator_map.map.call(mismatch$,function(_a){var rs=_a[0];return rs.path});newPath$.subscribe(function(url){return router.navigateByUrl(url)})}function setupRouterStore(router,location,dispatcher,store){return function(){listenForRouterMethodActions(router,location,dispatcher),connectRouterActions(router,store),listenForStoreChanges(router,store)}}function provideRouterConnector(){return{provide:_angular_core.APP_BOOTSTRAP_LISTENER,deps:[_angular_router.Router,_angular_common.Location,_ngrx_store.Dispatcher,_ngrx_store.Store],useFactory:setupRouterStore,multi:!0}}var routerActions={GO:"[Router] Go",REPLACE:"[Router] Replace",SEARCH:"[Router] Search",SHOW:"[Router] Show",BACK:"[Router] Back",FORWARD:"[Router] Forward",UPDATE_LOCATION:"[Router] Update Location"},routerActionTypes=Object.keys(routerActions).map(function(key){return routerActions[key]}),RouterStoreModule=function(){function RouterStoreModule(){}return RouterStoreModule.connectRouter=function(){return{ngModule:RouterStoreModule,providers:[provideRouterConnector()]}},RouterStoreModule.decorators=[{type:_angular_core.NgModule}],RouterStoreModule.ctorParameters=[],RouterStoreModule}();exports.routerActions=routerActions,exports.routerActionTypes=routerActionTypes,exports.go=go,exports.replace=replace,exports.search=search,exports.show=show,exports.back=back,exports.forward=forward,exports.routerReducer=routerReducer,exports.setupRouterStore=setupRouterStore,exports.provideRouterConnector=provideRouterConnector,exports.RouterStoreModule=RouterStoreModule,Object.defineProperty(exports,"__esModule",{value:!0})});
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@ngrx/store"),require("rxjs/operator/filter"),require("rxjs/operator/map"),require("rxjs/operator/withLatestFrom"),require("@ngrx/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/router","@ngrx/store","rxjs/operator/filter","rxjs/operator/map","rxjs/operator/withLatestFrom","@ngrx/core"],factory):factory((global.ngrx=global.ngrx||{},global.ngrx.routerStore=global.ngrx.routerStore||{}),global.ng.core,global.ng.common,global.ng.router,global.ngrx.store,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.ngrx.core)}(this,function(exports,_angular_core,_angular_common,_angular_router,_ngrx_store,rxjs_operator_filter,rxjs_operator_map,rxjs_operator_withLatestFrom,_ngrx_core){"use strict";function go(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.GO,payload:payload}}function replace(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.REPLACE,payload:payload}}function search(query,extras){var payload={query:query,extras:extras};return{type:routerActions.SEARCH,payload:payload}}function show(path,query,extras){var payload={path:path,query:query,extras:extras};return{type:routerActions.SHOW,payload:payload}}function back(){var payload={};return{type:routerActions.BACK,payload:payload}}function forward(){var payload={};return{type:routerActions.FORWARD,payload:payload}}function routerReducer(state,action){switch(void 0===state&&(state=initialState),action.type){case routerActions.UPDATE_LOCATION:return action.payload;default:return state}}function listenForRouterMethodActions(router,location,actions$){rxjs_operator_filter.filter.call(actions$,function(action){return routerActionTypes.indexOf(action.type)>-1}).subscribe(function(action){var _a=action.payload,path=_a.path,queryParams=_a.query,_b=_a.extras,extras=void 0===_b?{}:_b,commands=Array.isArray(path)?path:[path];switch(action.type){case routerActions.GO:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams}));break;case routerActions.REPLACE:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams,replaceUrl:!0}));break;case routerActions.SEARCH:var urlTree=router.parseUrl(router.url);urlTree.queryParams=queryParams,router.navigateByUrl(urlTree,extras);break;case routerActions.SHOW:router.navigate(commands,Object.assign({},extras,{queryParams:queryParams,skipLocationChange:!0}));break;case routerActions.BACK:location.back();break;case routerActions.FORWARD:location.forward()}})}function selectRouter(store){return _ngrx_core.select.call(store,function(state){return state.router})}function getLatestUrl(router){var navigationEnd$=rxjs_operator_filter.filter.call(router.events,function(event){return event instanceof _angular_router.NavigationEnd}),navigationEndUrl$=_ngrx_core.select.call(navigationEnd$,function(){return router.url});return navigationEndUrl$}function connectRouterActions(router,store){var routerAndStore$=rxjs_operator_withLatestFrom.withLatestFrom.call(getLatestUrl(router),selectRouter(store)),mismatchUrl$=rxjs_operator_filter.filter.call(routerAndStore$,function(_a){var url=_a[0],rs=_a[1];return rs&&rs.path!==url||!rs}),updateLocation$=rxjs_operator_map.map.call(mismatchUrl$,function(_a){var path=_a[0];return{type:routerActions.UPDATE_LOCATION,payload:{path:path}}});updateLocation$.subscribe(store)}function listenForStoreChanges(router,store){var storeAndRouter$=rxjs_operator_withLatestFrom.withLatestFrom.call(selectRouter(store),getLatestUrl(router)),mismatch$=rxjs_operator_filter.filter.call(storeAndRouter$,function(_a){var rs=_a[0],url=_a[1];return rs.path!==url}),newPath$=rxjs_operator_map.map.call(mismatch$,function(_a){var rs=_a[0];return rs.path});newPath$.subscribe(function(url){return router.navigateByUrl(url)})}function setupRouterStore(router,location,dispatcher,store){return function(){listenForRouterMethodActions(router,location,dispatcher),connectRouterActions(router,store),listenForStoreChanges(router,store)}}function provideRouterConnector(){return{provide:_angular_core.APP_BOOTSTRAP_LISTENER,deps:[_angular_router.Router,_angular_common.Location,_ngrx_store.Dispatcher,_ngrx_store.Store],useFactory:setupRouterStore,multi:!0}}var routerActions={GO:"[Router] Go",REPLACE:"[Router] Replace",SEARCH:"[Router] Search",SHOW:"[Router] Show",BACK:"[Router] Back",FORWARD:"[Router] Forward",UPDATE_LOCATION:"[Router] Update Location"},routerActionTypes=Object.keys(routerActions).map(function(key){return routerActions[key]}),initialState={path:null},RouterStoreModule=function(){function RouterStoreModule(){}return RouterStoreModule.connectRouter=function(){return{ngModule:RouterStoreModule,providers:[provideRouterConnector()]}},RouterStoreModule.decorators=[{type:_angular_core.NgModule}],RouterStoreModule.ctorParameters=[],RouterStoreModule}();exports.routerActions=routerActions,exports.routerActionTypes=routerActionTypes,exports.go=go,exports.replace=replace,exports.search=search,exports.show=show,exports.back=back,exports.forward=forward,exports.initialState=initialState,exports.routerReducer=routerReducer,exports.setupRouterStore=setupRouterStore,exports.provideRouterConnector=provideRouterConnector,exports.RouterStoreModule=RouterStoreModule,Object.defineProperty(exports,"__esModule",{value:!0})});

@@ -42,4 +42,7 @@ (function (global, factory) {

var initialState = {
path: null
};
function routerReducer(state, action) {
if (state === void 0) { state = null; }
if (state === void 0) { state = initialState; }
switch (action.type) {

@@ -157,2 +160,3 @@ case routerActions.UPDATE_LOCATION:

exports.forward = forward;
exports.initialState = initialState;
exports.routerReducer = routerReducer;

@@ -159,0 +163,0 @@ exports.setupRouterStore = setupRouterStore;

{
"name": "@ngrx/router-store",
"version": "1.2.3",
"version": "1.2.4",
"description": "Bindings to connect angular/router to ngrx/store",

@@ -5,0 +5,0 @@ "main": "bundles/router-store.umd.js",

@@ -5,2 +5,3 @@ import { Action } from '@ngrx/store';

}
export declare const initialState: RouterState;
export declare function routerReducer(state: RouterState, action: Action): RouterState;
import { routerActions } from './actions';
export var initialState = {
path: null
};
export function routerReducer(state, action) {
if (state === void 0) { state = null; }
if (state === void 0) { state = initialState; }
switch (action.type) {

@@ -5,0 +8,0 @@ case routerActions.UPDATE_LOCATION:

Sorry, the diff of this file is not supported yet

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