Last active
May 19, 2022 10:51
-
-
Save jsdf/e27e0e467dc8db3fb1e1 to your computer and use it in GitHub Desktop.
Chrome devtools formatter for Immutable-js
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 immutableJSFormatter = { | |
header(x) { | |
if (x && x.toJS) return ['span', {}, x.toString()]; | |
return null; | |
}, | |
hasBody(x) { | |
return x && x.toJS; | |
}, | |
body(x) { | |
return ['span', {}, JSON.stringify(x.toJS(), null, 2)]; | |
}, | |
}; | |
window.devtoolsFormatters = window.devtoolsFormatters || []; | |
window.devtoolsFormatters.push(immutableJSFormatter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot: