Skip to content

Commit

Permalink
UI console now stringify objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian committed Jul 12, 2017
1 parent 92e9b3c commit 80e0491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/store/user/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function before (appsState, action){
}

export function after (newAppsState, action, oldAppsState){
console.log("actions",actions)
console.log("action",action)
/* if(action.type == actions.user.changeName){
console.log("user / index / after >> actions.user.changeName -> you have change the users name")
}*/
Expand Down
11 changes: 4 additions & 7 deletions example/ui/console.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ConsoleElem extends Component {
window.console.log = function(){
consoleFn.apply(null,arguments)
const date = new Date();
const message = Array.prototype.slice.call(arguments).join(' ')
const message = Array.prototype.slice.call(arguments).map( arg => ("object" === typeof arg)?JSON.stringify(arg):arg ).join(' ')
messages.unshift({message, time:padNum(date.getHours())
+":"+
padNum(date.getMinutes())
Expand All @@ -33,22 +33,22 @@ class ConsoleElem extends Component {
}

render() {

const consoleStyle = {
overflow:"hidden",
padding:10,
width:"90vw",
height:"25vh",
backgroundColor:"black",
position: "absolute",
bottom: 10,
bottom: 10,
marginLeft: "auto",
marginRight: "auto",
left: 0,
right: 0,
borderRadius: 5
}

return <div style={consoleStyle}>
{
messages.map( lineElem )
Expand All @@ -58,6 +58,3 @@ class ConsoleElem extends Component {
}

export default ConsoleElem;



0 comments on commit 80e0491

Please sign in to comment.