Reactive State

screenshot of Reactive State

Redux-clone build with strict typing and RxJS down to its core. Wrist-friendly, no boilerplate or endless switch statements

Overview

Reactive State is an innovative state management library designed to be a typed, wrist-friendly alternative to Redux, particularly when using RxJS. Written in TypeScript, it promises a seamless experience for developers who prefer using plain JavaScript while taking full advantage of the powerful features RxJS offers. With its focus on reducing boilerplate code and improving developer experience, Reactive State stands out as an attractive option for managing application state.

The library has evolved from its original concept, heavily modified and extended to facilitate dynamic state management while maintaining strict type safety. Its design allows for easy integration and testing, making it a viable choice for modern web applications.

Features

  • Type-safe Actions: Avoid boilerplate code and eliminate the need for mandatory string constants or switch statements, thanks to actions being simple Observables.
  • Dynamic Reducers: Add and remove reducers at runtime without hassle, providing flexibility in managing state changes.
  • Async Handling: Actions are Observables that can be composed and transformed asynchronously using RxJS operators, negating the need for async middlewares like redux-thunk or redux-saga.
  • Single Store Concept: Utilize a single application-wide store similar to Redux while enjoying the built-in capabilities of RxJS, simplifying state management.
  • Typed for Safety: The library is strictly typed to help identify errors during compile time, ensuring more reliable code.
  • Comprehensive Testing: With over 100 unit tests for approximately 250 lines of code, Reactive State provides high confidence in its robustness and reliability.
  • React Bridge Included: Although using React is not mandatory, the library includes a bridge like react-redux for those who do choose to integrate with React.
  • Rich Documentation: Comes with thorough installation guides, example usage, and a demo app with annotated source code, making it easy to get started.
Redux

Redux is a state management library for JavaScript apps that provides a predictable and centralized way to manage application state. It enables developers to write actions and reducers that update the state in response to user interactions, server responses, and other events, and can be used with a variety of front-end frameworks and back-end technologies.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.