twreporter-redux
Advanced tools
Comparing version 2.1.2 to 2.1.3-beta.1
@@ -0,1 +1,4 @@ | ||
### 2.1.3 | ||
- Add isFetching in topics and topic reducers | ||
### 2.1.2 | ||
@@ -2,0 +5,0 @@ - Fetch topics if topics exist but is empty object |
@@ -34,3 +34,4 @@ 'use strict'; | ||
slug: topic1.slug, | ||
error: null | ||
error: null, | ||
isFetching: false | ||
}); | ||
@@ -49,3 +50,4 @@ }); | ||
slug: 'mock-slug', | ||
error: err | ||
error: err, | ||
isFetching: false | ||
}); | ||
@@ -70,3 +72,4 @@ }); | ||
total: 10, | ||
error: null | ||
error: null, | ||
isFetching: false | ||
}); | ||
@@ -87,5 +90,6 @@ }); | ||
total: 10, | ||
error: err | ||
error: err, | ||
isFetching: false | ||
}); | ||
}); | ||
}); |
@@ -53,16 +53,22 @@ 'use strict'; | ||
{ | ||
return { | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: null | ||
}; | ||
error: null, | ||
isFetching: false | ||
}); | ||
} | ||
case _actionTypes2.default.START_TO_GET_A_FULL_TOPIC: | ||
return { | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: null | ||
}; | ||
error: null, | ||
isFetching: true | ||
}); | ||
case _actionTypes2.default.ERROR_TO_GET_A_FULL_TOPIC: | ||
return action.payload; | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: _.get(action, 'payload.error'), | ||
isFetching: false | ||
}); | ||
default: | ||
@@ -90,3 +96,4 @@ return state; | ||
total: total, | ||
error: null | ||
error: null, | ||
isFetching: false | ||
}); | ||
@@ -97,7 +104,11 @@ } | ||
console.log('url to fetch:', action.url); | ||
return state; | ||
return _.merge({}, state, { | ||
error: null, | ||
isFetching: true | ||
}); | ||
case _actionTypes2.default.ERROR_TO_GET_TOPICS: | ||
return _.merge({}, state, { | ||
error: _.get(action, 'error') | ||
error: _.get(action, 'error'), | ||
isFetching: false | ||
}); | ||
@@ -104,0 +115,0 @@ default: |
{ | ||
"name": "twreporter-redux", | ||
"version": "2.1.2", | ||
"version": "2.1.3-beta.1", | ||
"description": "redux actions and reducers for twreporter website", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -33,2 +33,3 @@ /* global describe, it*/ | ||
error: null, | ||
isFetching: false, | ||
}) | ||
@@ -51,2 +52,3 @@ }) | ||
error: err, | ||
isFetching: false, | ||
}) | ||
@@ -77,2 +79,3 @@ }) | ||
error: null, | ||
isFetching: false, | ||
}) | ||
@@ -96,4 +99,5 @@ }) | ||
error: err, | ||
isFetching: false, | ||
}) | ||
}) | ||
}) |
@@ -22,16 +22,22 @@ import types from '../constants/action-types' | ||
case types.CHANGE_SELECTED_TOPIC: { | ||
return { | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: null, | ||
} | ||
isFetching: false, | ||
}) | ||
} | ||
case types.START_TO_GET_A_FULL_TOPIC: | ||
return { | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: null, | ||
} | ||
isFetching: true, | ||
}) | ||
case types.ERROR_TO_GET_A_FULL_TOPIC: | ||
return action.payload | ||
return _.merge({}, state, { | ||
slug: _.get(action, 'payload.slug'), | ||
error: _.get(action, 'payload.error'), | ||
isFetching: false, | ||
}) | ||
default: | ||
@@ -54,2 +60,3 @@ return state | ||
error: null, | ||
isFetching: false, | ||
}) | ||
@@ -60,3 +67,6 @@ } | ||
console.log('url to fetch:', action.url) | ||
return state | ||
return _.merge({}, state, { | ||
error: null, | ||
isFetching: true, | ||
}) | ||
@@ -66,2 +76,3 @@ case types.ERROR_TO_GET_TOPICS: | ||
error: _.get(action, 'error'), | ||
isFetching: false, | ||
}) | ||
@@ -68,0 +79,0 @@ default: |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
295353
5155
0
1