Gathering detailed insights and metrics for insular-observer
Gathering detailed insights and metrics for insular-observer
Gathering detailed insights and metrics for insular-observer
Gathering detailed insights and metrics for insular-observer
npm install insular-observer
Typescript
Module System
Node Version
NPM Version
69
Supply Chain
81.9
Quality
74.9
Maintenance
100
Vulnerability
100
License
TypeScript (62.91%)
JavaScript (37.09%)
Total Downloads
7,061
Last Day
1
Last Week
1
Last Month
42
Last Year
2,855
CC0-1.0 License
14 Commits
1 Forks
1 Watchers
11 Branches
2 Contributors
Updated on Dec 12, 2019
Minified
Minified + Gzipped
Latest Version
0.1.1
Package Id
insular-observer@0.1.1
Unpacked Size
16.74 kB
Size
5.77 kB
File Count
9
NPM Version
6.11.3
Node Version
12.12.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-66.7%
1
Compared to previous week
Last Month
-32.3%
42
Compared to previous month
Last Year
60.8%
2,855
Compared to previous year
1
6
Efficiently use an Observer (i.e. IntersectionObserver) without the ugly observer callback. insular-observer
gives you a simple, per-target observe/unobserve
API that uses the same observer instance internally.
Something like IntersectionObserver
is particularly lame to use because you get an array of events that may contain events for multiple targets - all in the same callback at the same time. It tempts you to make a new observer per target and just observe that single target with it, but it is more performant to reuse the observer and observe multiple targets (and so back to jerk-ugly-code). You can use insular-observer
to solve these issues.
1$ npm install insular-observer
InsularObserver(Observer, [options])
Pass the Observer class and constructor options (if applicable), get back a nice observe
function.
1const observeIntersection = InsularObserver(IntersectionObserver, { threshold: [ 0 ] })
2
3observeIntersection(fooTarget, entry => {
4 assert(fooTarget === entry.target) // true
5})
6observeIntersection(barTarget, entry => {
7 assert(barTarget === entry.target) // true
8})
observe(target, [options], listener)
Takes a target and a listener that only pertains to that target. Returns an unobserve
function you can call to stop listening.
The optional options
argument is to support Observers that take options in their observe
call (i.e. MutationObserver).
1const observeIntersection = InsularObserver(IntersectionObserver, { threshold: [ 0 ] }) 2 3const unobserve = observe(someTarget, entry => { // do stuff })
unobserve()
Returned from observe(target, listener)
. Stops listening to that listener.
1const observeIntersection = InsularObserver(IntersectionObserver, { threshold: [ 0 ] }) 2const unobserve = observe(someTarget, entry => { 3 // do stuff 4 5 unobserve() // stop listening 6})
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/14 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More