Skip to content

Commit db917a8

Browse files
committed
fix: better debug logs
1 parent 46bcaf0 commit db917a8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,25 @@ function createStore({
4949
// @TODO: flesh out the logic for when to notify react of state changes or not (as state updates can be expensive and we should be transient when possible)
5050
// @TODO: put updateSnapshot actions in the state machine as declared events
5151
// for now just re-render on every change and map out events in userland before abstracting them to the state machine
52-
console.groupCollapsed('state.changed')
52+
console.groupCollapsed('service.onTransition')
5353
transient = state
54-
console.log('transient', state.value, state.context)
54+
console.log(state.value, state.context)
5555
if (state.changed) {
5656
if (unstable__requestAnimationFrame) {
5757
cancelAnimationFrame(rAF)
5858
rAF = requestAnimationFrame(() => {
5959
console.group('onStoreChange')
60-
console.log({ value: state.value, context: state.context })
60+
console.log(state.value, state.context)
6161
transient = snapshot = state
6262
onStoreChange()
6363
console.groupEnd()
6464
})
6565
} else {
66+
console.group('onStoreChange')
67+
console.log(state.value, state.context)
6668
transient = snapshot = state
6769
onStoreChange()
70+
console.groupEnd()
6871
}
6972
}
7073
console.groupEnd()

0 commit comments

Comments
 (0)