byte-fe / react-model

The next generation state management library for React
236 stars 23 forks source link

fix(debugger): console.group not exist on RN #69

Closed ArrayZoneYour closed 5 years ago

leecade commented 5 years ago

good job

ArrayZoneYour commented 5 years ago

Issue source: https://github.com/rangle/redux-beacon/issues/147

leecade commented 5 years ago

HOW ABOUT

if (!console.group) {
  let groups = []
  let hr = '-'.repeat(80)
  console.group = function logGroupStart(label) {
    groups.push(label)
    console.log('%c \nBEGIN GROUP: %c', hr, label)
  }
  console.groupEnd = function logGroupEnd() {
    console.log('END GROUP: %c\n%c', groups.pop(), hr)
  }
}