11.) Which function is used to define multiple action handlers inside a reducer?
A) on()
B) handle()
C) reduceState()
D) mapState()
12.) How do you add NgRx Store to an Angular app?
A) import { StateModule } from ‘@ngrx/ngrx’;
B) import { NgRxModule } from ‘@angular/core’;
C) import { StoreModule } from ‘@ngrx/store’;
D) import { ReduxModule } from ‘@angular/platform-redux’;
13.) Which function in NgRx is used to define initial state?
A) createReducer()
B) initializeState()
C) setInitialState()
D) defineState()
14.) What does on() do inside a reducer in NgRx?
A) Handles HTTP requests
B) Binds effects to reducers
C) Configures the NgRx store
D) Defines how actions affect state
15.) What is createEffect() used for in NgRx?
A) To trigger UI animations
B) To trigger UI animations
C) To update local storage
D) To improve API performance
16.) What is the purpose of Actions in NgRx?
A) To define UI interactions
B) To create new components dynamically
C) To trigger state changes in the store
D) To manage routing logic
17.) What does StoreModule.forRoot() do in NgRx?
A) Initializes the global store in an Angular application
B) Creates a new Angular module
C) Registers new components dynamically
D) Handles API requests
18.) What is the purpose of createSelector() in NgRx?
A) To generate a new reducer
B) To handle side effects in effects
C) To modify an observable’s behavior
D) To optimize and retrieve specific pieces of state
19.) In an NgRx effect, which operator is commonly used to handle asynchronous actions?
A) mergeMap()
B) catchError()
C) finalize()
D) debounceTime()
20.) What is the key advantage of using the NgRx store over Angular services?
A) It prevents the use of observables
B) It offers centralized state management
C) It eliminates the need for HTTP requests
D) It directly modifies the DOM
Related