Installations
npm install @trellisorg/update
Developer Guide
Typescript
No
Module System
ESM
Node Version
18.18.2
NPM Version
9.8.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (97.62%)
HTML (1.13%)
JavaScript (0.84%)
SCSS (0.3%)
Shell (0.1%)
Developer
trellisorg
Download Statistics
Total Downloads
1,852
Last Day
3
Last Week
10
Last Month
57
Last Year
509
GitHub Statistics
71 Stars
342 Commits
19 Forks
3 Watching
52 Branches
7 Contributors
Bundle Size
750.00 B
Minified
453.00 B
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
1,852
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
2
@trellisorg/update
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.
Install
yarn
yarn add @trellisorg/update
npm
npm i @trellisorg/update --save
Usage
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
- Info: SAST configuration detected: CodeQL
- Warn: no pull requests merged into dev branch
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Info: no jobLevel write permissions found
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
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/trellisorg/platform/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/trellisorg/platform/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/trellisorg/platform/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/trellisorg/platform/codeql-analysis.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
4.9
/10
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