ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - rx-angular/rx-angular: Reactive Extensions for Angular.
Reactive Extensions for Angular. Contribute to rx-angular/rx-angular development by creating an account on GitHub.
Visit Site

GitHub - rx-angular/rx-angular: Reactive Extensions for Angular.

GitHub - rx-angular/rx-angular: Reactive Extensions for Angular.

RxAngular logo

RxAngular RxAngular CI

RxAngular offers a comprehensive toolkit for handling fully reactive Angular applications with the main focus on runtime performance, template rendering, and Developer eXperience.

Packages

RxAngular is made up of different packages that work together or standalone.

Package Description Version
@rx-angular/state A powerful state management library, providing a fully reactive way to manage state in components and services. npm
@rx-angular/template A set of directives and pipes designed for high-performance and non-blocking rendering for large-scale applications. npm
@rx-angular/cdk A Component Development Kit for high-performance and ergonomic Angular UI libs and large-scale applications. npm
@rx-angular/isr A library that enables Angular Universal applications to generate static pages at runtime and then update them incrementally on demand or on a schedule. npm
@rx-angular/eslint-plugin A set of ESLint rules for building reactive, performant, and zone-less Angular applications. npm

This repository holds a set of helpers that are aiming to provide:

  • fully reactive applications
  • fully or partially zone-less applications
  • high-performance and non-blocking rendering

Getting Started

Using @rx-angular/template

This is an example of how to use the *rxLet directive to bind an Observable value to the template. In this example, the component defines a property time$, which is an Observable that emits a value every second using the timer operator. The emitted values are mapped to the current time string using the map operator which is then displayed in the template using *rxLet.

import { RxLet } from '@rx-angular/template/let';

@Component({
  selector: 'app-time',
  standalone: true,
  imports: [RxLet],
  template: `
    <ng-container *rxLet="time$; let value">
      {{ value }}
    </ng-container>
  `,
})
export class TimeComponent {
  time$ = timer(0, 1000).pipe(map(() => new Date().toTimeString()));
}

To learn more about @rx-angular/template and its capabilities, check out the official documentation at https://rx-angular.io/docs/template.

Using @rx-angular/state

In this example, we're creating a fully reactive counter component. We use rxState to manage the component's state, rxActions to define structured actions for state updates (specifically increment and decrement), and rxEffects to trigger side-effects when state changes occur. These mechanisms collectively enable efficient state management, action handling, and side-effect execution, resulting in a responsive and well-structured counter component.

import { rxState } from '@rx-angular/state';
import { rxEffects } from '@rx-angular/state/effects';
import { rxActions } from '@rx-angular/state/actions';
import { RxPush } from '@rx-angular/template/push';

@Component({
  selector: 'app-counter',
  standalone: true,
  imports: [RxPush],
  template: `
    <p>Count: {{ count$ | push }}</p>
    <button (click)="actions.increment()">Increment</button>
    <button (click)="actions.decrement()">Decrement</button>
  `,
})
export class CounterComponent {
  readonly actions = rxActions<{
    increment: void;
    decrement: void;
  }>();

  private readonly state = rxState<{
    count: number;
  }>(({ set, connect }) => {
    set({ count: 0 });
    connect(this.actions.increment$, (state) => ({
      count: state.count + 1,
    }));
    connect(this.actions.decrement$, (state) => ({
      count: state.count - 1,
    }));
  });

  readonly count$ = this.state.select('count');

  constructor() {
    rxEffects(({ register }) => {
      register(this.count$, (count) => console.log(`Count changed: ${count}`));
    });
  }
}

To learn more about @rx-angular/state and its capabilities, check out the official documentation at https://rx-angular.io/docs/state.

Used by

Links

Contributing

We welcome contributions from the community to help improve RxAngular! To get started, please take a look at our contribution guidelines in the CONTRIBUTING.md file. We appreciate your help in making RxAngular better for everyone.

License

This project is MIT licensed.


Made with ❤ by push-based.io

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory