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

Revert "Change action types from string to symbol's to ensure unique actions" #9

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/stores/IAction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface IAction<T> {
type: symbol;
type: string;
payload?: T;
error?: boolean;
meta?: any;
Expand Down
2 changes: 1 addition & 1 deletion src/stores/loading/LoadingAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import IAction from '../IAction';

class LoadingAction {

public static readonly SET_LOADING: symbol = Symbol('SET_LOADING');
public static readonly SET_LOADING: string = 'LoadingAction.SET_LOADING';

public static showLoader(isLoading: boolean): IAction<boolean> {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/stores/meta/MetaAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import IAction from '../IAction';

class MetaAction {

public static readonly SET_META: symbol = Symbol('SET_META');
public static readonly SET_META: string = 'MetaAction.SET_META';

public static setMeta(meta: IMetaReducerState): IAction<IMetaReducerState> {
if (global.document) {
Expand Down
6 changes: 3 additions & 3 deletions src/stores/user/UserAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import IAction from '../IAction';

class UserAction {

public static readonly LOAD_USER: symbol = Symbol('LOAD_USER');
public static readonly LOAD_USER_SUCCESS: symbol = Symbol('LOAD_USER_SUCCESS');
public static readonly LOAD_USER_FAIL: symbol = Symbol('LOAD_USER_FAIL');
public static readonly LOAD_USER: string = 'UserAction.LOAD_USER';
public static readonly LOAD_USER_SUCCESS: string = 'UserAction.LOAD_USER_SUCCESS';
public static readonly LOAD_USER_FAIL: string = 'UserAction.LOAD_USER_FAIL';

public static loadUser(): IAction<void> {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/stores/user/UserSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UserSaga {
});

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

let data: IUserReducerState = null;

Expand Down