Questions tagged [ngredux]
15 questions
3
votes
1 answer
Angular + Redux Jasmine testing "Cannot read property 'dispatch' of undefined" randomly thrown in runs
I have an integration test that is dependant on 2 services which I am providing to the testbed with stubs.
When I am testing a function updateCategory() in the subscribe block of this category I have a function ngRedux.dispatch({type:…

SebastianG
- 8,563
- 8
- 47
- 111
1
vote
2 answers
How to get Observable that emits only when a property value changes in an array of objects in redux state?
I have redux state in angular app:
export interface UIAction {
name: string;
isActive: boolean;
}
export interface IUIState {
actions: UIAction[];
}
I have built an angular service that subscribes to the state and stores Subjects for…

char m
- 7,840
- 14
- 68
- 117
1
vote
1 answer
Listen for dispatched action in Redux
I'm wondering if there's a way to listen for an action that's been successfully dispatched in redux?
In the ngxs state management library for Angular, I can do the following:
ngOnInit() {
this.actions$
.pipe(
…

Tom
- 2,321
- 2
- 18
- 29
1
vote
1 answer
Getting errror - NullInjectorError: No provider for NgRedux! when integrating redux implementation
I was modifying the existing project to implement the redux implementation. Made the code changes, and found the below error while compiling. According to the learning material I have referred, ngRedux need not be added into the providers. Upon…

Jijil Kakkadathu
- 343
- 3
- 17
1
vote
1 answer
NgRedux + Angular + select triggered on subscribe
I'm using redux in my angular App for weeks now, but I just noticed something about it :
When I'm selecting a part of my store to monitor changes, let's say like that :
In the ngOnInit() of app.component.ts
this.ngRedux.select(s =>…

Nicolas Pretot
- 182
- 2
- 12
1
vote
1 answer
Updating/ Pushing new data into NgRedux state
I am new to Angular and writing service which I will be using to add new addresses (posting to a REST API).
The saveAddress method call returns a newly created address object on server.
Which I wanted to push into the already existing array of…

user1592129
- 461
- 1
- 5
- 16
1
vote
0 answers
Firefox issue: Encountered with this Exception { message: "", result: 3253927937, name: "NS_ERROR_NOT_INITIALIZED"..}
Encountered with this Exception
{ message: "",
result: 3253927937,
name: "NS_ERROR_NOT_INITIALIZED"..
}
We are using Angular 1.5v.
when using ngReduxProvider.createStoreWith() when logging second time only in Firefox but not in Chrome. When we…

shekar rao
- 33
- 5
1
vote
2 answers
Redux overwrites model with previous state
I am currently making a sample project in AngularJs combined with Redux.
I am struggling to get the mappings from the reducer working.
I have a simple input where users can set a new name together with a drop down to select a 'company'.

pmulders
- 89
- 5
0
votes
2 answers
Is it ok to make backend call using reducer in redux?
I'm building an angular website. Normally I made backend call in onInit method and store the data in an component state. Now I want to add redux to my website. Should I just raise action on the onInit method and make the actual backend call in redux…

Haha
- 148
- 1
- 8
0
votes
1 answer
how to mock new promise blocks in jasmine
I have following method in my service
initialStateData() {
if (!this.hasLoaded()) {
console.log('do you see me?? 1');
// next line erroring out here on..
console.log('do you see me?? 2');
this._dataLoadPromise =…

Extreme
- 2,919
- 1
- 17
- 27
0
votes
1 answer
Selecting an element by id from store in angular
I have the following data in the store:
{
properties :
[
{
_id: 123.
name: "Nice property"
},
{
_id: 456.
name: "Another nice property"
}
]
}
In my ngOnInit method I would like to select a property from the store…

Andra Zeberga
- 207
- 4
- 14
0
votes
1 answer
create a union type in typescript with methods of a class
I am looking at some legacy code and they have created all the redux reducers as instance methods of a class:
@Injectable()
export class PeopleActions {
constructor(private ngRedux: NgRedux) {}
add() {
this.ngRedux.dispatch({ADD,…

dagda1
- 26,856
- 59
- 237
- 450
0
votes
0 answers
Redirect to page after dispatching an action (ngredux)
I have a project with angular 6 + ngredux and I want an advice for the next situation:
I have an overview details page (read-only information), filled with data from the app state. In this page, I have some buttons which open other pages (here we…

BBE
- 11
- 2
0
votes
1 answer
Importing ng-redux just returns a string
I have problems importing ng-redux into my JS client app:
import ngRedux from 'ng-redux';
import needle from 'needle'; // just for debugging
console.log(`Testing: `, {ngRedux, needle});
Output from console is:
Testing: {
needle: {version:…

Tom Söderlund
- 4,743
- 4
- 45
- 67
0
votes
1 answer
Angular 5 and angular-rdux/store
I have installed Angular 5,
"@angular-redux/store": "^7.1.0",
"redux": "^3.7.2",
Here is my app.module.ts constructor:
constructor(ngRedux: NgRedux) {
console.log('Configuring ngRedux');
ngRedux.configureStore(rootReducer,…

Abhilash D K
- 1,223
- 1
- 23
- 39