PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.4
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.4
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / src / apps / js / admin / react / question / store / middlewares.js

middlewares.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.4, at assets/src/apps/js/admin/react/question/store/middlewares.js

48 lines 967 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * External dependencies
3 */
4 import refx from 'refx';
5
6 /**
7 * Internal dependencies
8 */
9 //import effects from './effects';
10
11 const effects = {
12 ENROLL_COURSE_X: ( action, store ) => {
13 enrollCourse:( action, store ) => {
14 const { dispatch } = store;
15
16 //dispatch()
17 };
18 },
19 };
20
21 /**
22 * Applies the custom middlewares used specifically in the editor module.
23 *
24 * @param {Object} store Store Object.
25 *
26 * @return {Object} Update Store Object.
27 */
28 function applyMiddlewares( store ) {
29 let enhancedDispatch = () => {
30 throw new Error(
31 'Dispatching while constructing your middleware is not allowed. ' +
32 'Other middleware would not be applied to this dispatch.'
33 );
34 };
35
36 const middlewareAPI = {
37 getState: store.getState,
38 dispatch: ( ...args ) => enhancedDispatch( ...args ),
39 };
40
41 enhancedDispatch = refx( effects )( middlewareAPI )( store.dispatch );
42
43 store.dispatch = enhancedDispatch;
44 return store;
45 }
46
47 export default applyMiddlewares;
48