Angular Reactive Development: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "=Introduction= ==Background== RxJs originally was developed by Microsoft in Rx.NET. It works on Java and other platforms. The definition is "RxJs is a library for composing as..."
 
Line 23: Line 23:
*Resilient to failure -error checking all the time
*Resilient to failure -error checking all the time
*Reactive to state changes
*Reactive to state changes
==Resources==
The demos were at https://github.com/DeborahK/Angular-RxJS

Revision as of 01:30, 6 December 2020

Introduction

Background

RxJs originally was developed by Microsoft in Rx.NET. It works on Java and other platforms. The definition is "RxJs is a library for composing asynchronous and event-based programs using observable sequences"

Other approaches

  • Callbacks - difficult to use with nested async operations
  • Promises - can only handle a single emission and is not cancellable
  • Asyc/await - can only handle a single emission and is not cancellable

Why Rxjs

  • One - technical for all data e.g. mouse clicks, api calls
  • Compositional - with the operators easy to transform and combine
  • Watchful - With its push model to notify subscribers
  • Laxy - Only executes when subscribed to
  • Handles Error - Built in
  • Cancellable

Angular already use RxJs in

  • Routing
  • Reactive Forms
  • HttpClient

Reactive Development

This is characterized by

  • Quick to react to user - drrrrrr
  • Resilient to failure -error checking all the time
  • Reactive to state changes

Resources

The demos were at https://github.com/DeborahK/Angular-RxJS