-
-
Save rjwaltz/5af1fe2045a340aca8357e0be49c98d2 to your computer and use it in GitHub Desktop.
A User Timing middleware for redux to create performance markers for dispatched actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment