egghead-redux | Egghead Redux Series by Dan Abramov | State Container library

 by   chrisrzhou JavaScript Version: Current License: No License

kandi X-RAY | egghead-redux Summary

kandi X-RAY | egghead-redux Summary

egghead-redux is a JavaScript library typically used in User Interface, State Container, React, Nodejs, Express.js, Jest applications. egghead-redux has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Egghead Redux Series by Dan Abramov
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              egghead-redux has a low active ecosystem.
              It has 33 star(s) with 15 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 1 have been closed. On average issues are closed in 2 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of egghead-redux is current.

            kandi-Quality Quality

              egghead-redux has no bugs reported.

            kandi-Security Security

              egghead-redux has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              egghead-redux does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              egghead-redux releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of egghead-redux
            Get all kandi verified functions for this library.

            egghead-redux Key Features

            No Key Features are available at this moment for egghead-redux.

            egghead-redux Examples and Code Snippets

            No Code Snippets are available at this moment for egghead-redux.

            Community Discussions

            QUESTION

            Integration test redux-observable that makes multiple ajax requests with debounce
            Asked 2018-Jun-19 at 02:44

            I have a redux-observable epic that polls an endpoint, getting progress updates until the progress is 100%. The polling interval is acheived using debounceTime like so:

            ...

            ANSWER

            Answered 2018-Jun-19 at 02:44

            Interestingly enough, I played around with your code and am fairly confident you just found a bug in the debounceTime operator, which causes the apparent swallowing the scheduled debounce. The bad news is that even if that bug is fixed, you're code still wouldn't do what you're looking for order wise.

            Bear with me as shit is about to get real:

            • Epic receives action PROCESSING and schedules debounce, yielding execution to your test
            • Your test calls scheduler.flush() and the VirtualScheduler executes the scheduled debounce work, which will pass along the original PROCESSING action to the mergeMap
            • Fake ajax is made, which synchronously emits a response
            • Response is mapped to the second PROCESSING action
            • Your epic emits that second action synchronously
            • The second action is recursively received by your epic and given to the debounce
            • The debounceTime operator now schedules that second action on the VirtualScheduler but the debounceTime operator is in the middle of executing the previously scheduled work still from the first action.
            • The call stack unwinds a bunch up until it reaches inside the previously scheduled debounce work from the first action that had just next()'d the first action. The rxjs code for debounceTime then sets this.lastValue = null and this.hasValue = false This is the rxjs bug, it needs to be done before nexting into the destination
            • The stack unwinds some more to the running flush() method of the VirtualScheduler, which now dequeues the second scheduled debounced action because it was added the scheduled work array synchronously, before this the flushing finished. Remember, we've only called scheduler.flush() ONCE so far, which is the function we're in back in at this point.
            • The second scheduled debounce work is run, but this.hasValue === false because the first scheduled one set it, so the debounceTime operator does not emit anything.
            • Stack unwinds to our first scheduler.flush()
            • We console.log('CHECK CORRECT STATE FOR PROGRESS 25')
            • All the other scheduler.flush() calls do nothing as there's nothing scheduled.

            This is technically a bug, but it's not surprising that no one has run into it since running debounce synchronously without any delay defeats the point of it, except when you're testing, of course. This ticket is basically the same thing and OJ says RxJS doesn't make reentrancy guarantees, but I that might be up for debate in this case. I've filed a PR with the fix to discuss

            Remember, this bug wouldn't have solved your underlying question about the ordering, but would have prevented the actions from being swallowed.

            Off the top of my head I'm not sure how you would do what you'd like to do specifically if you want to maintain 100% synchronous behavior (VirtualScheduler). You'd need some way of yielding to your test in between debounces. For me when and if I write integration tests I mock out very little, if anything. e.g. let the debounces actually debounce either naturally or by mocking out setTimeout to advance them quicker but still keeping them async which will yield back to your test allowing you to check the state, but making your test also async.

            For anyone wanting to reproduce, here's the StackBlitz code I used

            Source https://stackoverflow.com/questions/48142568

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install egghead-redux

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/chrisrzhou/egghead-redux.git

          • CLI

            gh repo clone chrisrzhou/egghead-redux

          • sshUrl

            git@github.com:chrisrzhou/egghead-redux.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular State Container Libraries

            redux

            by reduxjs

            vuex

            by vuejs

            mobx

            by mobxjs

            redux-saga

            by redux-saga

            mpvue

            by Meituan-Dianping

            Try Top Libraries by chrisrzhou

            react-globe

            by chrisrzhouJavaScript

            react-wordcloud

            by chrisrzhouJavaScript

            google-globe-trends

            by chrisrzhouJavaScript

            surveyless

            by chrisrzhouJavaScript

            qraffiti

            by chrisrzhouJavaScript