Skip to content

Commit

Permalink
fix: Removed all console.log statements
Browse files Browse the repository at this point in the history
These were just debug messages that were cluttering the console output in development mode.

fix #45
  • Loading branch information
nareshbhatia committed Oct 18, 2018
1 parent b16494e commit 86baa94
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
22 changes: 11 additions & 11 deletions src/adapters/history-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export class HistoryAdapter {
}

goToLocation = (location: Location): Promise<RouterState> => {
if (process.env.NODE_ENV === 'development') {
console.log(
`HistoryAdapter.goToLocation(${JSON.stringify(location)})`
);
}
// if (process.env.NODE_ENV === 'development') {
// console.log(
// `HistoryAdapter.goToLocation(${JSON.stringify(location)})`
// );
// }

// Find the matching route
const routes = this.routerStore.routes;
Expand Down Expand Up @@ -74,12 +74,12 @@ export class HistoryAdapter {
);
if (currentUrl !== routerStateUrl) {
this.history.push(routerStateUrl);
if (process.env.NODE_ENV === 'development') {
console.log(
`HistoryAdapter: history.push(${routerStateUrl}),`,
`history.length=${this.history.length}`
);
}
// if (process.env.NODE_ENV === 'development') {
// console.log(
// `HistoryAdapter: history.push(${routerStateUrl}),`,
// `history.length=${this.history.length}`
// );
// }
}
}
);
Expand Down
12 changes: 6 additions & 6 deletions src/adapters/static-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export class StaticAdapter {
}

goToLocation = (location: Location): Promise<RouterState> => {
/* istanbul ignore if */
if (process.env.NODE_ENV === 'development') {
console.log(
`StaticAdapter.goToLocation(${JSON.stringify(location)})`
);
}
// /* istanbul ignore if */
// if (process.env.NODE_ENV === 'development') {
// console.log(
// `StaticAdapter.goToLocation(${JSON.stringify(location)})`
// );
// }

// Find the matching route
const routes = this.routerStore.routes;
Expand Down
6 changes: 3 additions & 3 deletions src/components/router-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class RouterView extends React.Component<RouterViewProps, {}> {
routerStore: { routerState },
viewMap
} = this.props;
if (process.env.NODE_ENV === 'development') {
console.log(`RouterView.render() - ${JSON.stringify(routerState)}`);
}
// if (process.env.NODE_ENV === 'development') {
// console.log(`RouterView.render() - ${JSON.stringify(routerState)}`);
// }

const view = viewMap[routerState.routeName];
return view ? view : null;
Expand Down
24 changes: 12 additions & 12 deletions src/router-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,22 @@ export class RouterStore {
/* istanbul ignore if */
if (process.env.NODE_ENV === 'development') {
const fromStateStr = JSON.stringify(fromState);
console.log(
`RouterStore.transition(${fromStateStr}):`,
'states are equal, skipping'
);
// console.log(
// `RouterStore.transition(${fromStateStr}):`,
// 'states are equal, skipping'
// );
}
return toState;
}

/* istanbul ignore if */
if (process.env.NODE_ENV === 'development') {
const fromStateStr = JSON.stringify(fromState);
const toStateStr = JSON.stringify(toState);
console.log(
`RouterStore.transition(${fromStateStr}, ${toStateStr})`
);
}
// /* istanbul ignore if */
// if (process.env.NODE_ENV === 'development') {
// const fromStateStr = JSON.stringify(fromState);
// const toStateStr = JSON.stringify(toState);
// console.log(
// `RouterStore.transition(${fromStateStr}, ${toStateStr})`
// );
// }

// Get transition hooks from the two states
const { beforeExit, onExit } = this.getRoute(fromState.routeName);
Expand Down

0 comments on commit 86baa94

Please sign in to comment.