Skip to content

Commit 3d63d12

Browse files
committed
refactor actions
1 parent 689d83f commit 3d63d12

File tree

8 files changed

+9
-12
lines changed

8 files changed

+9
-12
lines changed

lib/actions/_types.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ exports.COMPLETE_PAGE = 'COMPLETE_PAGE';
55
exports.COMPLETE_TUTORIAL = 'COMPLETE_TUTORIAL';
66
exports.DEVTOOLS_TOGGLE = 'DEVTOOLS_TOGGLE';
77
exports.HINT_POSITION_SET = 'HINT_POSITION_SET';
8-
exports.HINT_SHOW = 'HINT_SHOW';
98
exports.PAGE_SET = 'PAGE_SET';
109
exports.PAGE_POSITION_SET = 'POSITION_SET';
1110
exports.PROGRESS_LOAD = 'PROGRESS_LOAD';

lib/actions/hint.js

-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@ function hintPositionSet(hintPosition) {
44
return { type: _types_1.HINT_POSITION_SET, payload: { hintPosition: hintPosition } };
55
}
66
exports.hintPositionSet = hintPositionSet;
7-
function hintShow() {
8-
return { type: _types_1.HINT_SHOW };
9-
}
10-
exports.hintShow = hintShow;

lib/actions/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exports.completePage = progress_1.completePage;
88
exports.completeTutorial = progress_1.completeTutorial;
99
exports.progressPagePositionLoad = progress_1.progressPagePositionLoad;
1010
var hint_1 = require('./hint');
11-
exports.hintShow = hint_1.hintShow;
1211
exports.hintPositionSet = hint_1.hintPositionSet;
1312
var page_1 = require('./page');
1413
exports.pageSet = page_1.pageSet;

lib/actions/tutorial.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
"use strict";
22
var _types_1 = require('./_types');
3+
var progress_1 = require('./progress');
4+
var route_1 = require('./route');
35
function tutorialSet(name) {
46
return function (dispatch, getState) {
57
var dir = getState().dir;
68
dispatch({ type: _types_1.TUTORIAL_SET, payload: { name: name, dir: dir } });
9+
dispatch(progress_1.progressLoad());
10+
dispatch(route_1.routeSet('progress'));
711
};
812
}
913
exports.tutorialSet = tutorialSet;

src/actions/_types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export const COMPLETE_PAGE = 'COMPLETE_PAGE';
44
export const COMPLETE_TUTORIAL = 'COMPLETE_TUTORIAL';
55
export const DEVTOOLS_TOGGLE = 'DEVTOOLS_TOGGLE';
66
export const HINT_POSITION_SET = 'HINT_POSITION_SET';
7-
export const HINT_SHOW = 'HINT_SHOW';
87
export const PAGE_SET = 'PAGE_SET';
98
export const PAGE_POSITION_SET = 'POSITION_SET';
109
export const PROGRESS_LOAD = 'PROGRESS_LOAD';

src/actions/hint.ts

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,3 @@ import {HINT_SHOW, HINT_POSITION_SET} from './_types';
33
export function hintPositionSet(hintPosition: number): Action {
44
return {type: HINT_POSITION_SET, payload: { hintPosition } };
55
}
6-
7-
export function hintShow(): Action {
8-
return { type: HINT_SHOW };
9-
}

src/actions/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export {
33
progressLoad, completePage, completeTutorial,
44
progressPagePositionLoad
55
} from './progress';
6-
export {hintShow, hintPositionSet} from './hint';
6+
export {hintPositionSet} from './hint';
77
export {pageSet, pageNext, pagePositionSet} from './page';
88
export {routeSet} from './route';
99
export {setupVerify, setupPackage} from './setup';

src/actions/tutorial.ts

+4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import {
22
TUTORIALS_FIND, TUTORIAL_UPDATE, TUTORIAL_SET,
33
ALERT_TOGGLE
44
} from './_types';
5+
import {progressLoad} from './progress';
6+
import {routeSet} from './route';
57

68
export function tutorialSet(name: string): ReduxThunk.ThunkInterface {
79
return (dispatch, getState): void => {
810
const {dir} = getState();
911
dispatch({ type: TUTORIAL_SET, payload: { name, dir } });
12+
dispatch(progressLoad());
13+
dispatch(routeSet('progress'));
1014
};
1115
}
1216

0 commit comments

Comments
 (0)