@bottom-sheet/react-hooks
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -27,2 +27,3 @@ var $dYZEH$bottomsheetstatemachine = require("@bottom-sheet/state-machine"); | ||
let transient = snapshot; | ||
let rAF = 0; | ||
return { | ||
@@ -35,14 +36,20 @@ subscribe: (onStoreChange)=>{ | ||
// for now just re-render on every change and map out events in userland before abstracting them to the state machine | ||
console.groupCollapsed("state.changed"); | ||
transient = state; | ||
console.log("transient", state.value, state.context); | ||
if (state.changed) { | ||
console.groupCollapsed("state.changed"); | ||
transient = snapshot = state; | ||
console.log(state.value, state.context); | ||
onStoreChange(); | ||
cancelAnimationFrame(rAF); | ||
rAF = requestAnimationFrame(()=>{ | ||
console.group("onStoreChange"); | ||
console.log({ | ||
value: state.value, | ||
context: state.context | ||
}); | ||
transient = snapshot = state; | ||
onStoreChange(); | ||
console.groupEnd(); | ||
}); | ||
console.groupEnd(); | ||
} else { | ||
console.groupCollapsed("state.changed: false"); | ||
transient = state; | ||
console.log(state.value, state.context); | ||
console.groupEnd(); | ||
} | ||
console.groupEnd(); | ||
}); | ||
@@ -49,0 +56,0 @@ console.debug("service.start"); |
@@ -22,2 +22,3 @@ import {defaultInitialHeight as $26Zo0$defaultInitialHeight, defaultSnapPoints as $26Zo0$defaultSnapPoints, BottomSheetMachine as $26Zo0$BottomSheetMachine, assignInitialHeight as $26Zo0$assignInitialHeight, assignSnapPoints as $26Zo0$assignSnapPoints} from "@bottom-sheet/state-machine"; | ||
let transient = snapshot; | ||
let rAF = 0; | ||
return { | ||
@@ -30,14 +31,20 @@ subscribe: (onStoreChange)=>{ | ||
// for now just re-render on every change and map out events in userland before abstracting them to the state machine | ||
console.groupCollapsed("state.changed"); | ||
transient = state; | ||
console.log("transient", state.value, state.context); | ||
if (state.changed) { | ||
console.groupCollapsed("state.changed"); | ||
transient = snapshot = state; | ||
console.log(state.value, state.context); | ||
onStoreChange(); | ||
cancelAnimationFrame(rAF); | ||
rAF = requestAnimationFrame(()=>{ | ||
console.group("onStoreChange"); | ||
console.log({ | ||
value: state.value, | ||
context: state.context | ||
}); | ||
transient = snapshot = state; | ||
onStoreChange(); | ||
console.groupEnd(); | ||
}); | ||
console.groupEnd(); | ||
} else { | ||
console.groupCollapsed("state.changed: false"); | ||
transient = state; | ||
console.log(state.value, state.context); | ||
console.groupEnd(); | ||
} | ||
console.groupEnd(); | ||
}); | ||
@@ -44,0 +51,0 @@ console.debug("service.start"); |
{ | ||
"name": "@bottom-sheet/react-hooks", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "The hooks that power `@bottom-sheet/react-spring`", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35482
244