Gathering detailed insights and metrics for change-emitter
Gathering detailed insights and metrics for change-emitter
Gathering detailed insights and metrics for change-emitter
Gathering detailed insights and metrics for change-emitter
Listen for changes. Like an event emitter that only emits a single event type. Really tiny.
npm install change-emitter
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
59 Stars
21 Commits
8 Forks
5 Watchers
15 Branches
4 Contributors
Updated on Jun 18, 2025
Latest Version
0.1.6
Package Id
change-emitter@0.1.6
Size
2.59 kB
NPM Version
4.2.0
Node Version
7.9.0
Published on
Apr 17, 2017
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
Listen for changes. Like an event emitter that only emits a single event type. Really tiny.
I extracted this from Redux's createStore()
because I found it to be useful in other contexts. Use it where you want the most minimal event subscription implementation possible.
1import { createChangeEmitter } from 'change-emitter' 2 3const emitter = createChangeEmitter() 4 5// Called `listen` instead of `subscribe` to avoid confusion with observable spec 6const unlisten = emitter.listen((...args) => { 7 console.log(args) 8}) 9 10emitter.emit(1, 2, 3) // logs `[1, 2, 3]` 11unlisten() 12emitter.emit(4, 5, 6) // doesn't log
Here's a (partial) implementation of Redux's createStore
:
1const createStore = (reducer, initialState) => { 2 let state = initialState 3 const emitter = createChangeEmitter() 4 5 function dispatch(action) { 6 state = reducer(state, action) 7 emitter.emit() 8 return action 9 } 10 11 function getState() { 12 return state 13 } 14 15 return { 16 dispatch, 17 getState, 18 subscribe: emitter.listen 19 } 20}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 3/16 approved changesets -- score normalized to 1
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license 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
58 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
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