Skip to content

Multiple callbacks when using "then" #204

Open

Description

@luke-unifymonitor

I'm using "then" to transform the response.

When combined with a refreshInterval it causes multiple requests if the props change.

Example in this code sandbox....

https://codesandbox.io/s/xrzrp27w4q

Click "Foo 1" and it calls api/1 every x seconds
Click "Foo 2" and it calls api/2 every x seconds with...but still calls api/1

Activity

  1. ryanbrainard commented on May 13, 2018

    @ryanbrainard
    Contributor

    That code sandbox doesn't seem to be using then or refreshInterval. Your description also doesn't seem to be using then, two clicks. Can you please clarify?

  2. luke-unifymonitor commented on May 14, 2018

    @luke-unifymonitor
    Author

    Hi Ryan,

    Can you have another look? I've placed all the code in index.js now so should be able to see it all from the default view.

    https://codesandbox.io/s/xrzrp27w4q

    Thanks, Luke

  3. ryanbrainard commented on May 16, 2018

    @ryanbrainard
    Contributor

    Thanks, definitely some kind of bug there. I haven't gotten a chance to dig into to see exactly what's wrong, but will mark this issue as a bug and will investigate more later (or if someone beats me to it, that's welcome :) )

  4. rjhilgefort commented on Jul 2, 2018

    @rjhilgefort

    I'm seeing this as well. My workaround was just to use another HOC that transformed the props after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions