feat: add useScrollTrigger, useTransform, useEffectEvent (port of #11)#13
Merged
Conversation
Port the scroll hooks from Clément Roche's #11 onto the packages/hamo structure: - useEffectEvent: promote the stable-callback helper to a public hook; use-debounce now consumes it (removes the private useStableCallback duplicate). - useTransform / TransformProvider: context-based transform accumulation for parallax compensation. Zero dependencies. - useScrollTrigger + Debugger: scroll-progress tracking with GSAP-style position syntax, optional Lenis integration (graceful native-scroll fallback), exposed with the debug overlay behind the hamo/scroll-trigger/debugger subpath. lenis is an optional peer dependency; the debug store's emitter is inlined so hamo keeps zero runtime dependencies. Playground gains a /scroll-trigger demo. Co-Authored-By: Clément Roche <rchclement@gmail.com>
7 tasks
… index Advertise the newly ported hooks in the playground's Available Hooks list (brought over from #11).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Brings Clément Roche's scroll hooks (#11) into the v1
packages/hamolibrary: useScrollTrigger (scroll-progress tracking for scrollytelling), useTransform / TransformProvider (parallax), and a public useEffectEvent. They were stranded on a branch built against the old repo layout; this re-applies them to the restructured monorepo so they ship with v1.Summary
useEffectEventpromoted to a public hook;use-debouncenow consumes it (removes the privateuseStableCallbackduplicate).useTransform/TransformProvider— zero-dep context transform accumulation for parallax.useScrollTrigger+Debugger— position syntax, optional Lenis integration with graceful native-scroll fallback; debug overlay behind thehamo/scroll-trigger/debuggersubpath export.lenisis an optional peer dependency; the store emitter is inlined so hamo keeps zero runtime dependencies./scroll-triggerdemo.Test Plan
astro check0 errors, 3 pages)Ports #11 — credit @clementroche (Co-Authored-By on the commit).