Installations
npm install @rx-signals/store
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.12.1
NPM Version
8.19.2
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (99.92%)
JavaScript (0.08%)
Developer
gneu77
Download Statistics
Total Downloads
14,229
Last Day
5
Last Week
42
Last Month
113
Last Year
1,137
GitHub Statistics
10 Stars
208 Commits
1 Watching
2 Branches
1 Contributors
Bundle Size
58.19 kB
Minified
15.47 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0-rc46
Package Id
@rx-signals/store@3.0.0-rc46
Unpacked Size
711.10 kB
Size
108.11 kB
File Count
107
NPM Version
8.19.2
Node Version
18.12.1
Publised On
24 Feb 2023
Total Downloads
Cumulative downloads
Total Downloads
14,229
Last day
0%
5
Compared to previous day
Last week
-19.2%
42
Compared to previous week
Last month
13%
113
Compared to previous month
Last year
-76.6%
1,137
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@rx-signals/store
Reactive state and effects management
:warning: This documentation is work in progress for the upcoming 3.0.0 version. There is however NO good reason to use 2.x over 3.0.0-rc46, so please start with the rc-version (3.0.0 will be the first version I'm going to advertise publicly, so it's more like a 1.0 in reality.). 2.x is deprecated and will NOT be maintained in any way.
It's mainly documentation that needs improvement prior to the final 3.0.0 realease. It is however possible that I will introduce minor breaking changes until 3.0.0 is finally released.
Installation
npm install --save @rx-signals/store@3.0.0-rc46
Dependencies
RxJs is the one and only dependency.
License
What is it?
rx-signals is a library for the MVU (Model-View-Update) pattern.
It is however not limited to MVU, but can be used in all architectures that would benefit from its features:
- Immutable State Management
- Global and/or local
- Reactive Programming
- High-level abstractions over RxJs (you can still go as low as you want)
- Effects Management
- Clean side-effect isolation
- Mock-less testing of your application logic
- An alternative to Redux, NgRx or other MVU-libs
- Less boilerplate / More DRY
- More abstractions / Better reusability
Though it heavily relies on RxJs, this lib is not Angular-specific. You can (and should) also use it in any other context where you have RxJs at your disposal!
(Use it in the backend or with any presentation-framework you like. Decoupling application-logic from presentation-logic is a strength of this library.)
rx-signals itself is implemented with TypeScript and therefore naturally comes with first-class type-safety.
High-level overview
This lib comes with a
- Store for
- State-management based on the RP (reactive programming) concepts of events and behaviors (generalized as signals)
- Reactive dependency injection
- Signals- and SignalsBuilder Types as
- Encapsulation/Abstraction-layer over low-level signal-composition
- SignalsFactory as
- Abstraction-layer over the SignalsBuilder-type for high-level composition and reusability (enabling DRY architecture)
- EffectSignalsFactory as
- SignalsFactory that covers side-effect-scenarios generically, encapsulating and abstracting away all the pitfalls and possibilities to shoot yourself in the foot.
- Full type-safety everywhere
See rx-signals design goals for more.
Getting started
Terminology
What does rx-signals mean anyway? Well the rx stands for reactive extensions, so it's the same rx as in RxJs, giving tribute to this congenial lib that is the base of rx-signals. The term signals is lent from the world of functional reactive programming (FRP), that knows two types of signals. The first type are Events being a signal of values occurring at discrete points of time. The second type of signals are Behaviors that represent values that vary over time in response to Events.
In RP (Reactive Programming), we can define Events and Behaviors as follows:
- Event-streams:
- Value-streams that have no current value
- Publish values (events) to subscribers at discrete points of time
- Can depend on other event-streams and/or behaviors
- Behaviors:
- Value-Streams that always have a current value (though possibly lazy)
- Current value can change at discrete points in time (published to subscribers)
- Can depend on other behaviors and/or event-streams
So an RxJs example for behaviors would be a BehaviorSubject, while an example for event-streams would be a Subject. Thus, in RxJs-world you can translate signal as observable.
Directions
You should start with my introduction to MVU, State Management, Reactive Programming and Effects Management, if
- you don't know what any of these terms mean
- you like to understand the basis for the rx-signals architecture
- you think State Management is only about having a global state and how to modify it
- you think you're doing RP, just because you're using something like RxJs
- you think Effects Management is only about managing async processes (like http calls)
- you don't know that all these things are tied together
Otherwise, you may start with Using rx-signals. Where necessary, it will still link to the corresponding passages of the formerly mentioned introduction.
The full API-documentation (as generated from the doc strings) can be found here
If you want to use this library in an Angular project, I suggest using the @rx-signals/angular-provider in addition.
An introduction for people with NgRx background can be found here
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
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
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
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
2.3
/10
Last Scanned on 2025-01-27
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