reflow-rejector
Library intended to be used with development mode only. Will console.error or alert if too many reflows are detected
Last updated 6 months ago by erictsai6 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install reflow-rejector 
SYNC missed versions from official npm registry.

reflow-rejector

Small library to alert if any reflow abuses are detected

The purpose of this library is to monitor the runtime usage of javascript APIs that are known to trigger reflows. Reference link

Demo

Demo Gif

Installation

npm install reflow-rejector

Usage

import { ReflowRejector } from 'reflow-rejector';

// Config is optional
const config = {
    maxAllowed: 10, // default 10
    intervalMs: 1500, // default 1500
    alertType: 'ALERT', // default 'ALERT' - ['ALERT', 'CONSOLE']
    alertFrequencyMs: 600000 // default 10 minutes == 600,000 ms
};

ReflowRejector.initialize(config);

// If you wish to disable it then tear it down
ReflowRejector.teardown();

Development

Feel free to pull down this source code and hack at it yourself.

  • Demo server
    • npm run dev
    • This will start a small web server that will automatically pull in the source code
    • http://localhost:8080/
  • Unit tests / Integration tests
    • npm run test
    • npm run test:watch
    • Both will run the *.spec.ts files and the one marked integration.spec.ts will test the entire flow using karma and a real browser.

Current Tags

  • 1.0.4                                ...           latest (6 months ago)

5 Versions

  • 1.0.4                                ...           6 months ago
  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           6 months ago
  • 1.0.1                                ...           6 months ago
  • 1.0.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |