更新时间:2021-08-27 19:56:57
封面
Title Page
Copyright and Credits
Architecting Angular Applications with Redux RxJS and NgRx
Packt Upsell
Why subscribe?
PacktPub.com
Foreword
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Quick Look Back at Data Services for Simple Apps
Model-View-Controller – the pattern we all know
Cohesion and coupling – establishing a common language
Explaining the components of MVC
The model
The view
The controller
Interactions – the behavior between the components
MVC summary
An MVC flow in Angular
The component – a controller and a building block
First responder to a route
Used as a building block
Components from an architectural standpoint
NgModule – our new facade (and some other bits)
Using ES2015 modules
Consuming a module
An Angular example
Multiple exports
The default import/export
Renaming imports
The service
Service without dependencies
Service with dependencies
Dependency Injection
Dependency Injection in Angular using providers
Overriding an existing construct
Overriding at runtime
Overriding constants
Resolving your dependencies with @Injectable
Fetching and persisting data with HTTP – introducing services with Observables
Fetching data with the HTTP service
Summary
1.21 Gigawatt – Flux Pattern Explained
Core concepts overview
A uniform data flow
Action – capture the intent
Dispatcher – the spider in the web
Listening to the dispatcher
The store – managing state data retrieval and callbacks
Demoing a uniform data flow
Creating a selection view
Adding the dispatcher
Adding the store
Adding a selected view
Running the demo
Adding more actions to our flow
Cleaning up the view
Cleaning up the store
Adding EventEmitter
Adding to and cleaning up the register method
Further improvements
Adding immutability
Summarizing
Adding AJAX calls
An even bigger solution
Asynchronous Programming
The callback pattern
The callback pattern on the web
The callback pattern in Node.js
Problems with structuring async code – callback hell
Promises
Thenables
Handling rejected promises
Chaining – dealing with several promises
Asynchronous libraries
Async library
async.map()
async.parallel()
async.series()
Async/await
Functional Reactive Programming
Functional programming versus imperative programming
Imperative programming versus declarative programming
First-class higher-order functions
Pure functions