You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2017/12/15 21:01:01 UTC
[GitHub] Antonio-Maranhao commented on a change in pull request #1036: move revision browser to use redux
Antonio-Maranhao commented on a change in pull request #1036: move revision browser to use redux
URL: https://github.com/apache/couchdb-fauxton/pull/1036#discussion_r157297673
##########
File path: app/addons/documents/rev-browser/actions.js
##########
@@ -63,81 +57,77 @@ function getConflictingRevs (paths, winner, deleted) {
});
}
-function dispatchData (tree, doc, conflictingRevs, conflictDoc, databaseName) {
- FauxtonAPI.dispatch({
+const dispatchData = (tree, doc, conflictingRevs, conflictDoc, databaseName) => {
+ return {
type: ActionTypes.REV_BROWSER_REV_TREE_LOADED,
options: {
- tree: tree,
- doc: doc,
- conflictDoc: conflictDoc,
- conflictingRevs: conflictingRevs,
- databaseName: databaseName
+ tree,
+ doc,
+ conflictDoc,
+ conflictingRevs,
+ databaseName
}
- });
-}
+ };
+};
-function toggleDiffView (enableDiff) {
- FauxtonAPI.dispatch({
+export const toggleDiffView = (enableDiff) => {
+ return {
type: ActionTypes.REV_BROWSER_DIFF_ENABLE_DIFF_VIEW,
options: {
enableDiff: enableDiff
}
- });
-}
+ };
+};
-function chooseLeaves (doc, revTheirs) {
+export const chooseLeaves = (doc, revTheirs) => dispatch => {
db.get(doc._id, {rev: revTheirs})
.then((res) => {
- dispatchDocsToDiff(doc, res);
+ dispatch(dispatchDocsToDiff(doc, res));
});
-}
+};
-function dispatchDocsToDiff (doc, theirs) {
- FauxtonAPI.dispatch({
+const dispatchDocsToDiff = (doc, theirs) => {
Review comment:
Same here, rename to `docsToDiff`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services