Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widgets should check for repeated 'newResults' events #30

Open
schloett opened this issue Nov 6, 2015 · 0 comments
Open

widgets should check for repeated 'newResults' events #30

schloett opened this issue Nov 6, 2015 · 0 comments

Comments

@schloett
Copy link

schloett commented Nov 6, 2015

The 'newResults' event might be thrown several times with the same data attached. Therefore, each widget should check, if it already processed the data. This should be possible via the queryID. Exemplary sketch:

var lastProcessedQueryID;
window.onmessage = function(msg) {
  if(msg.data.event && msg.data.event === 'eexcess.newResults') {
    if(lastProcessedQueryID && lastProcessedQueryID === msg.data.data.queryID) {
      // data already processed, do nothing
    } else {
      // process data
      // ....
      // store queryID of last processed data
      lastProcessedQueryID = msg.data.data.queryID;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant