Gathering detailed insights and metrics for @trellisorg/update
Gathering detailed insights and metrics for @trellisorg/update
npm install @trellisorg/update
Typescript
Module System
Node Version
NPM Version
TypeScript (97.62%)
HTML (1.13%)
JavaScript (0.84%)
SCSS (0.3%)
Shell (0.1%)
Total Downloads
1,852
Last Day
3
Last Week
10
Last Month
57
Last Year
509
71 Stars
342 Commits
19 Forks
3 Watching
52 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.3
Package Id
@trellisorg/update@1.0.3
Unpacked Size
15.25 kB
Size
5.05 kB
File Count
9
NPM Version
9.8.1
Node Version
18.18.2
Publised On
05 Nov 2023
Cumulative downloads
Total Downloads
Last day
-78.6%
3
Compared to previous day
Last week
-56.5%
10
Compared to previous week
Last month
78.1%
57
Compared to previous month
Last year
-37.2%
509
Compared to previous year
1
2
Provides a decorator (@Update
) that allows you to hook into the assignment of a property in a class and then call some
function on an injectable to update it.
yarn
yarn add @trellisorg/update
npm
npm i @trellisorg/update --save
1@Injectable() 2class Store { 3 readonly counter$ = new BehaviorSubject<number>(0); 4 5 readonly counter2$ = new BehaviorSubject<number>(0); 6 7 readonly setCounter = (value: number) => this.counter$.next(value); 8 9 readonly setCounterTwo = (value: number) => this.counter2$.next(value); 10} 11 12@Component({ 13 selector: 'test', 14 styles: [''], 15 template: `<div id="input"> 16 {{ counter }} 17 </div> 18 <div id="observable">{{ counter$ | async }}</div> 19 <div id="input"> 20 {{ counterTwo }} 21 </div> 22 <div id="observable">{{ counterTwo$ | async }}</div>`, 23 providers: [Store], 24}) 25class TestComponent { 26 // Will call `setCounter` on the instantiated `Store` 27 // whenever `counter` is assigned a new value. 28 @Input() @Update(Store) counter = 0; 29 30 // Will call `setCounterTwo` on the instantiated `Store` 31 // whenever `counterTwo` is assigned a new value 32 @Input() @Update(Store, 'setCounterTwo') counterTwo = 0; 33 34 readonly counter$ = this.store.counter$; 35 36 readonly counterTwo$ = this.store.counter2$; 37 38 constructor(private readonly store: Store) {} 39}
Caveat: Properties must be explicitly defined, if they are optional properties you have to set them to
undefined
otherwise this library cannot patch the correct setters on the property.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
SAST tool detected: CodeQL
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-20
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