JSPM

  • Created
  • Published
  • Downloads 12702
  • Score
    100M100P100Q168455F
  • License MIT

@rx-angular/state is a light-weight, flexible, strongly typed and tested tool dedicated to reduce the complexity of managing component state and side effects in angular

Package Exports

  • @rx-angular/state
  • @rx-angular/state/bundles/state.umd.js
  • @rx-angular/state/fesm2015/state.js
  • @rx-angular/state/selections

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rx-angular/state) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@rx-angular/state

npm rx-angular CI Coverage Status

Reactive Component State for Angular

RxState is a lightweight, flexible, strongly typed and tested tool dedicated to reduce the complexity of managing component state in Angular.

state logo

Sub Modules

Intro Video

intro-video_rx-angular--state-rx-state

Description

Developing modern, reactive user interfaces imposes a variety of challenging tasks. Naming some of those:

  • reacting to events from different sources
  • transforming and composing state
  • handling state lifetime
  • handling subscriptions

There are plenty of solutions available for managing these challenges on a global level (Akita, NgRx, NgXs, ...). None of them is dedicated to targeting the particular needs of the component level.

@rx-angular/state was specifically designed to give developers a tool for mastering component state without forcing them to use complex design patterns.

Its lightweight and intuitive API and the automatic subscription handling makes @rx-angular/state the perfect fit for handling state in any Angular component.

Using this library allows you to implement things like:

  • merge global into local state
  • shared state selections
  • subscription-less interaction
  • hook into imperative functions (e.g. component lifecycle or HostBindings)

with very little effort in any component.

Key features

  • Slim and intuitive API
  • Automated subscription handling
  • Intuitive way for handling ViewModels
  • Connect any Observable source to the state
  • Partial state updates
  • Reactive state selection
  • Lazy state (no BehaviourSubject)
  • Foundation for zone-less Angular applications

Install

npm install --save @rx-angular/state
# or
yarn add @rx-angular/state

Update

If you are using @rx-angular/state already, please consider upgrading with the @angular/cli update command in order to make sure all provided code migrations are processed properly.

ng update @rx-angular/state
# or with nx
nx migrate @rx-angular/state

Usage

Usage Documentation

Testing

Testing

API

API Documentation

Tutorials

Snippets

Vidoes

intro-video_rx-angular--state-rx-state🎥 RxAngular State, The Component Reactive Store | Marmicode Tasting Session

tackling-component-state-reactively🎥 Tackling Component State Reactively (Live Demo at 24:47)

Blogs/Documents

OSS Example Applications

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
IE11, Edge last version last version last 2 versions last 2 versions