Gathering detailed insights and metrics for @semantic-ui-react/event-stack
Gathering detailed insights and metrics for @semantic-ui-react/event-stack
Gathering detailed insights and metrics for @semantic-ui-react/event-stack
Gathering detailed insights and metrics for @semantic-ui-react/event-stack
[DEPRECATED] A React component for binding events on the global scope
npm install @semantic-ui-react/event-stack
Typescript
Module System
Node Version
NPM Version
TypeScript (88.96%)
JavaScript (11.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Stars
30 Commits
1 Forks
2 Watchers
19 Branches
3 Contributors
Updated on Apr 06, 2023
Latest Version
3.1.3
Package Id
@semantic-ui-react/event-stack@3.1.3
Unpacked Size
92.03 kB
Size
17.74 kB
File Count
32
NPM Version
6.14.12
Node Version
10.24.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
41
Issues mentioned in README
should be solved by other approaches:
.addEventListener()
is blazing fast and is not a real performance issuePlease avoid usages of this library.
A React component for binding events on the global scope.
1yarn add @semantic-ui-react/event-stack 2# or 3npm install @semantic-ui-react/event-stack
The EventStack
solves two design problems:
element.addListener()
.1import React, { Component } from 'react' 2import EventStack from '@semantic-ui-react/event-stack' 3 4class MyComponent extends Component { 5 handleResize = () => { 6 console.log('resize') 7 } 8 9 render() { 10 return ( 11 <div> 12 <EventStack name="resize" on={this.handleResize} target="window" /> 13 </div> 14 ) 15 } 16}
When doing server side rendering, document and window aren't available. You can use a string as a target
, or check that they exist before rendering the component with exenv
, for example.
You should avoid passing inline functions for listeners, because this creates a new Function instance on every render, defeating EventListener
's shouldComponentUpdate
, and triggering an update cycle where it removes its old listeners and adds its new listeners (so that it can stay up-to-date with the props you passed in).
The EventStack
is a public API that allows subscribing a DOM node to events. The event subscription for
each unique DOM node creates a new EventTarget
object.
+------------+ +-------------+
| | 0..* | |
| EventStack | +------> | EventTarget |
| | | |
+------------+ +-------------+
Each EventTarget
is assigned to an unique DOM node. An EventTarget
tracks event handlers for
the target's DOM node. Making multiple subscriptions to a click
event for a single DOM node will
result in a single registered handler
for that DOM node. An EventPool
also handles EventPool
relations, it stores only unique pools.
+-------------+ +---------+
| | 0..* | |
| EventTarget | +------> | handler |
| | | |
+-------------+ +---------+
+ +-----------+
| 0..* | |
+----------------> | EventPool |
| |
+-----------+
A handler
is a generated function that will notify the corresponding subscribed EventPool
.
An EventPool
notifies its EventSet
, while an EventSet
stores a set of subscribed
event handlers. An EventSet
is also responsible for event ordering and dispatching to
subscribed handlers.
+-----------+ +----------+
| | 1 | |
| EventPool | +---> | EventSet |
| | | |
+-----------+ +----------+
The idea of a React component is taken from react-event-listener
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/30 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
97 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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