# preact-waypoint

> minimal port of react-waypoint to preact

Latest version **1.0.7** (published 2017-03-08) · 0 weekly downloads

## Install

```sh
npm install preact-waypoint
pnpm add preact-waypoint
yarn add preact-waypoint
bun add preact-waypoint
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2017-03-08 |
| First published | 2016-10-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | dzhurley |
| Maintainers | dzhurley |

## Links

- npm: https://www.npmjs.com/package/preact-waypoint
- Repository: https://github.com/dzhurley/preact-waypoint
- Issues: https://github.com/dzhurley/preact-waypoint/issues
- npm.io page: https://npm.io/package/preact-waypoint

## Recent versions

- 1.0.7 (latest) — 2017-03-08
- 1.0.6 — 2017-01-23
- 1.0.5 — 2017-01-05
- 1.0.4 — 2016-12-12
- 1.0.3 — 2016-10-20
- 1.0.2 — 2016-10-19
- 1.0.1 — 2016-10-19
- 1.0.0 — 2016-10-19

## README

# preact-waypoint

Super minimal port of [react-waypoint](https://github.com/brigade/react-waypoint) to work with [Preact](https://preactjs.com/), supporting a subset of the [react-waypoint](https://github.com/brigade/react-waypoint) props.

## Install

    npm install preact-waypoint

## Usage

`<Waypoint />` should be placed at the end of whatever list or scrollable section that needs to fire a callback once reached:

```javascript
const { h, render } = require('preact');
const Waypoint = require('preact-waypoint');

const List = ({ items }) => (
    <ul class="list">
        { items.map(i => <li class="item">{i}</li>) }
        <Waypoint
            onEnter={() => console.log('just entered Waypoint')}
            onLeave={() => console.log('just left Waypoint')}
        />
    </ul>
);

render(<List items={['sweet', 'dude', 'awesome', 'neat']} />, document.body);
```

## Props

`onEnter` and `onLeave` function like their counterparts in [react-waypoint](https://github.com/brigade/react-waypoint).

`container` is optional, defaulting to `window`, and must be a parent element that has either `overflow: scroll-y;` or `overflow: scroll;` set to allow for scrolling. This decision was to make explicit the implicit DOM crawling that [react-waypoint](https://github.com/brigade/react-waypoint) does to find a `scrollableAncestor`.

## Contributing

Pull requests welcome! This project isn't intended to closely track its React counterpart but instead provide similar but minimal functionality to Preact users.

---
_Source: https://npm.io/package/preact-waypoint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
