Skip to content

Commit 4329a4c

Browse files
update baseApi.js : rename this._state to
this.state and make it none enumerable
1 parent 625b617 commit 4329a4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/api/baseApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import actions from '../stateManagement/actions';
22
import Helper from '../helper.js';
33
function BaseApi({helper, initialState}) {
44
this._helper = helper;
5-
this._state = this._helper.getCopyState(initialState); // it will be updated after each render
65
this._dispatch = null;
76
this._setFlushState = null;
87
this._isReady = false;
98
helper.setNoneEnumProps(this, {
9+
state: this._helper.getCopyState(initialState), // it will be updated after each render
1010
forceUpdateState: {},
11-
previousState: this._helper.getCopyState(initialState), // it is a previous value of this._state
11+
previousState: this._helper.getCopyState(initialState), // it is a previous value of this.state
1212
stateRef: {}, // have a same reference with state . It will be updated in each execution of useDynamicTabs.js
1313
});
1414
}
@@ -39,8 +39,8 @@ Helper.setNoneEnumProps(BaseApi.prototype, {
3939
return this;
4040
},
4141
updateState: function (state) {
42-
this.previousState = this._helper.getCopyState(this._state);
43-
this._state = this._helper.getCopyState(state);
42+
this.previousState = this._helper.getCopyState(this.state);
43+
this.state = this._helper.getCopyState(state);
4444
return this;
4545
},
4646
updateFlushState: function (setFlushState) {

0 commit comments

Comments
 (0)