Skip to content
Listen when some element just appear above the browser's page fold
JavaScript
Branch: master
Clone or download
Latest commit 8c52791 Oct 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.babelrc
.editorconfig
.eslintrc.json
.gitignore chore: create project config Oct 25, 2019
LICENSE.md
README.md
jest.config.js chore: create project config Oct 25, 2019
package-lock.json
package.json
project.json
webpack.conf.base.js
webpack.conf.dev.js
webpack.conf.prod.js
webpack.config.js

README.md

Fyzer

The easiest way to be notified when some element appears above the page fold

CircleCI codecov

Installation

$ npm install -S @glorious/fyzer

Usage

import fyzer from '@glorious/fyzer';

const element = document.querySelector('#myElement');

const subscriptionId = fyzer.subscribe(element, () => {
  // This function will be called every time
  // element appears above the fold.
});

// When you no longer needs to observe the element's position,
// you can unsubscribe from Fyzer:
fyzer.unsubscribe(subscriptionId);

Contributing

  1. Install Node. Download the "Recommend for Most Users" version.

  2. Clone the repo:

git clone git@github.com:glorious-codes/glorious-fyzer.git
  1. Go to the project directory:
cd glorious-fyzer
  1. Install the project dependencies:
npm install

Tests

Ensure that all code that you have added is covered with unit tests:

npm run test -- --coverage
You can’t perform that action at this time.