Skip to content

Instantly share code, notes, and snippets.

@pookdeveloper
Created September 27, 2023 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pookdeveloper/8fc01ffc4804cabd52e5ffcdcac49ae3 to your computer and use it in GitHub Desktop.
Save pookdeveloper/8fc01ffc4804cabd52e5ffcdcac49ae3 to your computer and use it in GitHub Desktop.
custom formatter snippet
window.devtoolsFormatters = [{
header: function(obj) {
if(!obj.__format){
return null
}
delete obj.__format;
return ['div', {}, `${JSON.stringify(obj, null, 2)}`]
},
hasBody: function(){
return false;
}
}]
fj = (obj) => {
console.log({...obj, __format: true});
};
console.format = (obj) => {
console.log({...obj, __format: true});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment