Skip to content

console logger plugin for structured-recat-hook

License

Notifications You must be signed in to change notification settings

kinop112365362/srh-plugins-logger

Repository files navigation

Srh-Plugins-Logger

Quick Start

import { srhLogger } from 'srh-plugins-logger'
import { createStore } from 'structured-react-hook'

const useStore = createStore(
  {
    initState: {name:''},
    service:{
      helloWorld(){
        this.rc.setName('hello world')
      }
    }
    controller: {
      onMount(){
        this.service.helloWorld()
      }
    }
  },
  [srhLogger]
)
function App(){
  const store = useStore()
  useEffect(()=>{
    store.controller.onMount()
  },[])
  return(
    <div>{store.state.name}</div>
  )
}

运行会输出如下 Logger

[Ctrl] onMount

[Service] helloWorld 'helloWorld'

[Reducer Case] setName '' → 'helloWorld'

About

console logger plugin for structured-recat-hook

Resources

License

Stars

Watchers

Forks

Packages

No packages published