3 options
Architecting angular applications with Redux, RxJS, and NgRx : learn to build Redux style high-performing applications with Angular 6 / Christoffer Noring.
- Format:
- Book
- Author/Creator:
- Noring, Christoffer, author.
- Language:
- English
- Subjects (All):
- AngularJS (Software framework).
- Computer programming.
- Physical Description:
- 1 online resource (364 pages)
- Edition:
- 1st edition
- Place of Publication:
- Birmingham ; Mumbai : Packt Publishing, 2018.
- System Details:
- text file
- Summary:
- Manage state in Angular to write high performing web apps by combining the power of Flux, RxJS, and NgRx About This Book Learn what makes an excellent Angular application architecture Use Redux to write performant, consistent Angular applications Incorporate Reactive Programming principles and RxJS to make it easier to develop, test, and debug your Angular applications Who This Book Is For If you have been developing Angular applications and want to dive deeper into the Angular architecture with Redux, RxJS, and NgRx to write robust web apps, then this book is for you. What You Will Learn Understand the one-way data flow and Flux pattern Work with functional programming and asynchronous data streams Figure out how RxJS can help us address the flaws in promises Set up different versions of cascading calls Explore advanced operators Get familiar with the Redux pattern and its principles Test and debug different features of your application Build your own lightweight app using Flux, Redux, and NgRx In Detail Managing the state of large-scale web applications is a highly challenging task with the need to align different components, backends, and web workers harmoniously. When it comes to Angular, you can use NgRx, which combines the simplicity of Redux with the reactive programming power of RxJS to build your application architecture, making your code elegant and easy to reason about, debug, and test. In this book, we start by looking at the different ways of architecting Angular applications and some of the patterns that are involved in it. This will be followed by a discussion on one-way data flow, the Flux pattern, and the origin of Redux. The book introduces you to declarative programming or, more precisely, functional programming and talks about its advantages. We then move on to the reactive programming paradigm. Reactive programming is a concept heavily used in Angular and is at the core of NgRx. Later, we look at RxJS, as a library and master it. We thoroughly describe how Redux works and how to implement it from scratch. The two last chapters of the book cover everything NgRx has to offer in terms of core functionality and supporting libraries, including how to build a micro implementation of NgRx. This book will empower you to not only use Redux and NgRx to the fullest, but also feel confident in building your own version, should you need it. Style and approach This book covers everything there is to know to get well-acquainted with Ang...
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Foreword
- Contributors
- Table of Contents
- Preface
- Chapter 1: 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
- Chapter 2: 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
- Chapter 3: 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
- Chapter 4: Functional Reactive Programming
- Functional programming versus imperative programming
- Imperative programming versus declarative programming
- First-class higher-order functions
- Pure functions
- Recursion
- No more loops
- Reoccurring pattern
- Summarise
- Count
- Width
- Asynchronous data streams
- Comparing lists to async streams - preparing for RxJS
- Combining the functional programming paradigm with streams
- Projection
- Filtering
- Combining mindsets
- Chapter 5: RxJS Basics
- Observer pattern
- RxJS core concepts
- Observable and Observer
- Producer
- Observable error and completion
- Operator
- Creating Observables
- Creation operators
- of()
- interval()
- from()
- fromEvent()
- bindCallback()
- Cleanup
- Subscriptions
- Creating a core implementation of RxJS
- Implementing create()
- Handling subscriptions
- Adding operators
- Revisiting the basics, adding errors, and complete
- Chapter 6: Manipulating Streams and Their Values
- Starting out
- Understanding operators
- Stream in a stream
- AJAX
- fetch()
- ajax() operator
- Cascading calls
- A deeper look
- of() operator
- from() operator
- range() operator
- fromEvent() operator
- Combination
- merge() operator
- combineLatest()
- zip()
- concat()
- Mathematical
- max
- min
- sum
- Time.
- interval() operator
- timer() operator
- delay() operator
- sampleTime() operator
- debounceTime() operator
- Grouping
- buffer() operator
- bufferTime() operator
- Thinking in streams
- Chapter 7: RxJS Advanced
- Hot, cold, and warm Observables
- Making a stream hot
- Warm streams
- Subjects
- Using Subject for cascading lists
- BehaviorSubject
- ReplaySubject
- AsyncSubject
- Error handling
- Catch and continue
- Ignoring the error
- Retry
- Advanced Retry
- Marble testing
- Set up
- Writing your first marble test
- Fleshing out with more tests
- Pipeable operators
- Creating reusable operators with let()
- Shifting to pipeable operators
- Chapter 8: Redux
- Principles
- Single source of truth
- Read-only states
- Changing states with pure functions
- Core concepts
- Immutability patterns
- Changing a list
- Changing an object
- Using reducers
- Merging all reducers together
- Data flow
- Creating the action
- Creating a controller class - create-view.js
- Creating a store implementation
- Testing out our store
- Cleaning up the implementation
- Creating our second controller class - list-view.js
- Adding subscription capability to our store
- Creating a program
- Setting up our environment
- Creating the missing files and running our program
- Dealing with asynchronous calls
- Creating a demo with Redux and asynchronous
- Best practices
- Chapter 9: NgRx - Reduxing that Angular App
- NgRx overview
- A word on state management
- @ngrx/store - state management
- A more complex example - a list
- A cleanup example
- Create a dedicated directory and feature module
- Add reducer and constants
- Moving the component to our jedi directory
- Registering our reducer with the store
- Leveraging types and feature modules.
- Going from forRoot() to forFeature()
- Setting up forFeature() from string to selection function
- Introducing NgRx types for setting up the state
- Giving forFeature() a type
- Several states in the same feature module
- Adding the counter-list reducer
- Adding the component
- Adding the constants
- Adding the action methods
- Adding the model
- Register our reducers
- Component architecture
- @ngrx/store-devtools - debugging
- @ngrx/effects - working with side effects
- Installing and setting it up
- Creating our first effect - a realistic scenario
- Creating our constants
- Action creators
- Reducer with a new type of default state
- The effect - listening to a specific dispatched action
- Adding a component - introducing selectors
- Extending our example with the create effect
- Updating the constants file
- Updating the reducer
- Additional actions
- Adding another effect
- Supporting the effect in our component
- Running a demo of the app
- Chapter 10: NgRx - In Depth
- @ngrx/entity
- Setting it up
- Selecting our data
- Adding the full CRUD
- Creating users
- Updating users
- Deleting users
- @ngrx/router-store
- Installation and set up
- Investigating the router state
- Custom serialization
- Navigating through dispatch
- Understanding NgRx - building our own micro implementation
- Adding a store
- Merging the states in a better way
- Implementing a reducer and integrating it with the store
- Dealing with slices of state
- Handling side effects
- @ngrx/schematics
- Generating constructs
- Generating actions
- Generating a container
- Generating an effect
- Generating an entity
- Generating a feature
- Generating a reducer
- Generating a store
- Other Books You May Enjoy
- Index.
- Notes:
- Description based on print version record.
- OCLC:
- 1030818516
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.