JSPM

  • Created
  • Published
  • Downloads 35407
  • Score
    100M100P100Q160069F
  • License MIT

Primitive to manage scrolling

Package Exports

  • @solid-primitives/scroll

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@solid-primitives/scroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@solid-primitives/scroll

lerna

Helpful primitives to manage browser scrolling.

createScrollObserver - Helpful monitor that reports the current position of an element or window.

Primitive ideas:

createScrollTo - A primitive to support scroll to a target createHashScroll - A primitive to support scrolling based on a hashtag change

How to use it

const position = createScrollObserver();

or

let ref;
const position = createScrollObserver(() => ref);

Demo

You may view a working example here: https://codesandbox.io/s/solid-primitives-scroll-csg7f

Changelog

Expand Changelog

0.0.100

Initial porting of the scroll primitive.

Contributors

Ported from the amazing work by at https://github.com/dance2die/react-use-localstorage.