Skip to content

feat: add useScrollTrigger, useTransform, useEffectEvent (port of #11)#13

Merged
arzafran merged 2 commits into
feat/v1from
feat/scroll-trigger-port
Jun 8, 2026
Merged

feat: add useScrollTrigger, useTransform, useEffectEvent (port of #11)#13
arzafran merged 2 commits into
feat/v1from
feat/scroll-trigger-port

Conversation

@arzafran

@arzafran arzafran commented Jun 8, 2026

Copy link
Copy Markdown
Member

What this does

Brings Clément Roche's scroll hooks (#11) into the v1 packages/hamo library: 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

  • useEffectEvent promoted to a public hook; use-debounce now consumes it (removes the private useStableCallback duplicate).
  • useTransform / TransformProvider — zero-dep context transform accumulation for parallax.
  • useScrollTrigger + Debugger — position syntax, optional Lenis integration with graceful native-scroll fallback; debug overlay behind the hamo/scroll-trigger/debugger subpath export.
  • lenis is an optional peer dependency; the store emitter is inlined so hamo keeps zero runtime dependencies.
  • Playground gains a /scroll-trigger demo.

Test Plan

  • typecheck + lint + build clean
  • 46 unit tests pass
  • playground builds (astro check 0 errors, 3 pages)
  • published tarball: new hooks + debugger present, runtime deps still none, lenis externalized

Ports #11 — credit @clementroche (Co-Authored-By on the commit).

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>
… index

Advertise the newly ported hooks in the playground's Available Hooks list
(brought over from #11).
@arzafran arzafran merged commit 428de5e into feat/v1 Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant