A User Timing middleware for redux to create performance markers for dispatched actions
const timing = store => next => action => { | |
performance.mark(`${action.type}_start`); | |
let result = next(action); | |
performance.mark(`${action.type}_end`); | |
performance.measure( | |
`${action.type}`, | |
`${action.type}_start`, | |
`${action.type}_end` | |
); | |
return result; | |
}; |
This comment has been minimized.
This comment has been minimized.
I second this, very useful middleware ! |
This comment has been minimized.
This comment has been minimized.
Thanks! Exactly what I need :-) |
This comment has been minimized.
This comment has been minimized.
Wow, thanks! I’d never seen these comments before |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Wanted to thank you for this! Popped up first when I googled "user timing api redux" and worked flawlessly.