couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benkeen <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Changes auto-update option added
Date Mon, 13 Apr 2015 18:57:34 GMT
Github user benkeen commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/368#discussion_r28267782
  
    --- Diff: app/addons/documents/changes/actions.js ---
    @@ -38,11 +45,59 @@ function (app, FauxtonAPI, ActionTypes) {
           });
         },
     
    -    setChanges: function (options) {
    +    initChanges: function (options) {
           FauxtonAPI.dispatch({
    -        type: ActionTypes.SET_CHANGES,
    +        type: ActionTypes.INIT_CHANGES,
             options: options
           });
    +      this.getLatestChanges();
    +    },
    +
    +    getLatestChanges: function () {
    +      var params = {};
    +
    +      var lastSeqNum = changesStore.getLastSeqNum();
    --- End diff --
    
    I just tried this, but for the initial request it can't be a `longpoll` or I don't ever
get the first batch of data returned. But I like using 'now' as a default - much cleaner -
so I refactored the code a bit to only set it to longpoll once `currentRequest` has been set.
Bit cleaner. [Will commit in a moment]


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message