Angular NgRx Flashcards

1
Q

Managing states and interaction with that states

A

Managing states and interaction with that states

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is State

A

VIEW STATE = information about the view, whether to display specific fields or UI elements

USER INFORMATION = such as users name and role
that is used to tailor the application for the user

ENTITY DATA = such as product information that is displayed and manipulated by the application but originally retrieved from and stored on a back end server somewhere

USER SELECTION INPUT = current selected input or entered filtered string or any information data that application tracks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Purpose of NgRx

A

Provider formal pattern for managing application state into one single local state container

Managing the state by requiring one way data flow

Communicating state changes to our compnents, so they can react accordingly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Deciding on State Management.Do I need this data again, will I use it more than once?

A

State management is recycling your data. Will you need that value again in other parts of your application? Use state management. Do you only need to store the value temporarily and reference it in a specific component, only for it to be discarded shortly after that? Don’t use state management.

Asking yourself the following question should be the litmus test you apply to your development workflow. Will you need this value again and will you need it in other parts of your application? Type it up, print it out and hang it up on your wall.

The purpose of state management is not to play the role of “random kitchen drawer full of miscellaneous items”, it exists to make cross-component and cross-application data access easier as well as ensuring the integrity and shape of the data remains intact (in part due to Javascript passing everything by reference).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly