From 3827947790719013573cd896d9ce07748b9bc342 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 14 Jul 2017 07:59:58 -0500 Subject: [PATCH] refactor(Devtools): Show complex structures in monitor (#79) This will not serialize the data before sending it to the Devtools extension, allowing it to handle complex structures including circular references from the RouterState when using @ngrx/router-store. --- example-app/app/app.module.ts | 2 +- example-app/app/routes.ts | 2 +- modules/store-devtools/src/extension.ts | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/example-app/app/app.module.ts b/example-app/app/app.module.ts index 02c4748bc8..9af8a879f6 100644 --- a/example-app/app/app.module.ts +++ b/example-app/app/app.module.ts @@ -42,7 +42,7 @@ import { environment } from '../environments/environment'; /** * @ngrx/router-store keeps router state up-to-date in the store. */ - // StoreRouterConnectingModule, + StoreRouterConnectingModule, /** * Store devtools instrument the store retaining past versions of state diff --git a/example-app/app/routes.ts b/example-app/app/routes.ts index f085e66ffc..47543e2041 100644 --- a/example-app/app/routes.ts +++ b/example-app/app/routes.ts @@ -6,7 +6,7 @@ export const routes: Routes = [ { path: '', redirectTo: '/books', pathMatch: 'full' }, { path: 'books', - loadChildren: 'app/books/books.module#BooksModule', + loadChildren: './books/books.module#BooksModule', canActivate: [AuthGuard], }, { path: '**', component: NotFoundPageComponent }, diff --git a/modules/store-devtools/src/extension.ts b/modules/store-devtools/src/extension.ts index b6b3fa2404..b98651b328 100644 --- a/modules/store-devtools/src/extension.ts +++ b/modules/store-devtools/src/extension.ts @@ -35,7 +35,7 @@ export interface ReduxDevtoolsExtension { send( action: any, state: any, - shouldStringify?: boolean, + options?: boolean | { serialize: boolean | object }, instanceId?: string ): void; } @@ -60,7 +60,12 @@ export class DevtoolsExtension { return; } - this.devtoolsExtension.send(null, state, false, this.instanceId); + this.devtoolsExtension.send( + null, + state, + { serialize: false }, + this.instanceId + ); } private createChangesObservable(): Observable {