Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit 2faca33

Browse files
authored
Revert "Change action types from string to symbol's to ensure unique actions. Remove text namespace because it is no longer needed. (#8)" (#9)
This reverts commit 243bed0.
1 parent 243bed0 commit 2faca33

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/stores/IAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface IAction<T> {
2-
type: symbol;
2+
type: string;
33
payload?: T;
44
error?: boolean;
55
meta?: any;

src/stores/loading/LoadingAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import IAction from '../IAction';
22

33
class LoadingAction {
44

5-
public static readonly SET_LOADING: symbol = Symbol('SET_LOADING');
5+
public static readonly SET_LOADING: string = 'LoadingAction.SET_LOADING';
66

77
public static showLoader(isLoading: boolean): IAction<boolean> {
88
return {

src/stores/meta/MetaAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import IAction from '../IAction';
33

44
class MetaAction {
55

6-
public static readonly SET_META: symbol = Symbol('SET_META');
6+
public static readonly SET_META: string = 'MetaAction.SET_META';
77

88
public static setMeta(meta: IMetaReducerState): IAction<IMetaReducerState> {
99
if (global.document) {

src/stores/user/UserAction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import IAction from '../IAction';
22

33
class UserAction {
44

5-
public static readonly LOAD_USER: symbol = Symbol('LOAD_USER');
6-
public static readonly LOAD_USER_SUCCESS: symbol = Symbol('LOAD_USER_SUCCESS');
7-
public static readonly LOAD_USER_FAIL: symbol = Symbol('LOAD_USER_FAIL');
5+
public static readonly LOAD_USER: string = 'UserAction.LOAD_USER';
6+
public static readonly LOAD_USER_SUCCESS: string = 'UserAction.LOAD_USER_SUCCESS';
7+
public static readonly LOAD_USER_FAIL: string = 'UserAction.LOAD_USER_FAIL';
88

99
public static loadUser(): IAction<void> {
1010
return {

src/stores/user/UserSaga.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class UserSaga {
1313
});
1414

1515
const response: Response = yield fetch('https://randomuser.me/api/?inc=picture,name,email,phone,id,dob');
16-
const type: symbol = (response.status === 200) ? UserAction.LOAD_USER_SUCCESS : UserAction.LOAD_USER_FAIL;
16+
const type: string = (response.status === 200) ? UserAction.LOAD_USER_SUCCESS : UserAction.LOAD_USER_FAIL;
1717

1818
let data: IUserReducerState = null;
1919

0 commit comments

Comments
 (0)