Skip to content

Commit

Permalink
fix: remove decimal point since the lowest it can count is until mill…
Browse files Browse the repository at this point in the history
…iseconds
  • Loading branch information
jk-gan committed Apr 18, 2020
1 parent d6a815f commit b6763b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ const registerPlugin = () => {
};

const viewer = (store: any) => (next: any) => (action: { type: string }) => {
let before = store.getState();
let startTime = Date.now();
let before = store.getState();
let result = next(action);
if (currentConnection) {
let after = store.getState();
let now = Date.now();

let state = {
id: startTime,
time: dayjs(startTime).format('HH:mm:ss.SSS'),
took: `${(now - startTime).toFixed(2)} ms`,
took: `${now - startTime} ms`,
action,
before,
after,
Expand Down

0 comments on commit b6763b0

Please sign in to comment.