|
@@ -7,10 +7,10 @@
|
|
|
**/
|
|
|
|
|
|
import NAME from './constants'
|
|
|
-import { call, put, takeEvery } from 'redux-saga/effects'
|
|
|
+// import { call, put, takeEvery } from 'redux-saga/effects'
|
|
|
|
|
|
/** actionTypes define what actions are handeled by the reducer. */
|
|
|
-const actionTypes = {
|
|
|
+export const actionTypes = {
|
|
|
CREATE_REQ: `${NAME}/CREATE_REQ`,
|
|
|
UPDATE_REQ: `${NAME}/UPDATE_REQ`,
|
|
|
DELETE_REQ: `${NAME}/DELETE_REQ`
|
|
@@ -38,10 +38,13 @@ function remove (projectId) {
|
|
|
projectId
|
|
|
}
|
|
|
}
|
|
|
-const actions = { create, update, remove }
|
|
|
+export const actions = { create, update, remove }
|
|
|
+
|
|
|
+/** state definition */
|
|
|
+export const state = []
|
|
|
|
|
|
/** reducer is called by the redux dispatcher and handles all component actions */
|
|
|
-function reducer (state = {}, action) {
|
|
|
+export function reducer (state = {}, action) {
|
|
|
switch (action.type) {
|
|
|
case actionTypes.CREATE:
|
|
|
return {
|
|
@@ -63,7 +66,7 @@ function reducer (state = {}, action) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/** sagas are asynchronous workers (JS generators) to handle the state. */
|
|
|
+/** sagas are asynchronous workers (JS generators) to handle the state.
|
|
|
// Worker
|
|
|
export function * incrementAsync () {
|
|
|
try {
|
|
@@ -83,6 +86,5 @@ export function * watchIncrementAsync () {
|
|
|
function * sagas () {
|
|
|
yield takeEvery('INCREMENT_REQUEST')
|
|
|
yield takeEvery('DECREMENT_REQUEST')
|
|
|
-}
|
|
|
-
|
|
|
-export default { actionTypes, actions, reducer, sagas }
|
|
|
+} */
|
|
|
+export const sagas = null
|