I just deleted and installed node_modules again and for some reason i can no longer access this.actions anymore in the Actions.js file. Here is my HomeActions.js file code :
import alt from '../../alt';
import request from 'superagent';
class HomeActions {
constructor() {
this.generateActions(
'updateUserSuccess',
'updateUserFail',
'logoutSuccess',
'logoutFail'
);
}
getUser() {
console.log(this); /*by console logging this i figured out there is
no actions object present in "this." but in the older version of my app before i
updated my dependencies actions object and dispatch func() were a part of "this."*/
request
.get('api/getuser')
.end((err, res) => {
this.actions.updateUserSuccess(res.text); //undefined
//alt.actions.HomeActions.updateUserSuccess(res.text);
//also tried calling actions in this way but getting dispatch error
});
}
}
export default alt.createActions(HomeActions);
Can someone explain to me whats going on ? Thanks alot <3
I just deleted and installed node_modules again and for some reason i can no longer access this.actions anymore in the Actions.js file. Here is my HomeActions.js file code :
Can someone explain to me whats going on ? Thanks alot <3