How do I check for anonymous functions?redux observable: Why don`t can get all actions in testredux-observable epic chain dispatches duplicate actionswhat should each chained function return in redux-observable?Why Doesn't This Bit of Code Work Without My Hack?Dispatching additional actions conditionally from redux-observable epicHow to prevent starting the same call twice from epicAwait the asynchronous dispatch of an action in redux-observableHow to dispatch an action in retryWhen of ajax request in epic function [redux-observable middleware]IF in Redux Observable epicRxJS iif arguments are called when shouldn't

Bit one of the Intel 8080's Flags register

How do we know that black holes are spinning?

Extra initial Aeneid lines in 1662 M. de Marolles version

Why does Kubuntu 19.04 show an update that apparently doesn't exist?

What 68-pin connector is this on my 2.5" solid state drive?

Why is it called a stateful and a stateless firewall?

What do these two notes together mean?

How to make classical firearms effective on space habitats despite the coriolis effect?

Insight into cavity resonators

Are there objective criteria for classifying consonance v. dissonance?

How to give my students a straightedge instead of a ruler

What was the ultimate objective of The Party in 1984?

A command to output each line forward then backwards

Why is belonging not transitive?

Answer Not A Fool, or Answer A Fool?

Why is my fire extinguisher emptied after one use?

In what state are satellites left in when they are left in a graveyard orbit?

Wrong Schengen Visa exit stamp on my passport, who can I complain to?

What would happen if Protagoras v Euathlus were heard in court today?

Teleport everything in a large zone; or teleport all living things and make a lot of equipment disappear

Why is this sentence grammatical?

Amortized Loans seem to benefit the bank more than the customer

Statistical tests for benchmark comparison

How to draw a Venn diagram for X - (Y intersect Z)?



How do I check for anonymous functions?


redux observable: Why don`t can get all actions in testredux-observable epic chain dispatches duplicate actionswhat should each chained function return in redux-observable?Why Doesn't This Bit of Code Work Without My Hack?Dispatching additional actions conditionally from redux-observable epicHow to prevent starting the same call twice from epicAwait the asynchronous dispatch of an action in redux-observableHow to dispatch an action in retryWhen of ajax request in epic function [redux-observable middleware]IF in Redux Observable epicRxJS iif arguments are called when shouldn't






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have the following in an Epic:



mergeMap(result => concat(
of(fetchDone(result)),
of(dispatchActions(payload))
))


And actions:



const fetchDone = result => ( type: "FETCH_DONE", payload: result );

function dispatchActions(payload)
return dispatch =>
dispatch(doStuff(payload));
...
;



The issue is in my test using marbles, I need to be able to check for the anonymous function because dispatchActions is seen as anonymous. How do I do that?



const values = 
...
b: type: "FETCH_DONE", payload: expected ,
c: NEEDS TO BE ANONYMOUS
;

...
const output$ = fetchApi(action$, state$);

// This fails due to the anonymous function
expectObservable(output$).toBe('---(bc)--', values);









share|improve this question






























    0















    I have the following in an Epic:



    mergeMap(result => concat(
    of(fetchDone(result)),
    of(dispatchActions(payload))
    ))


    And actions:



    const fetchDone = result => ( type: "FETCH_DONE", payload: result );

    function dispatchActions(payload)
    return dispatch =>
    dispatch(doStuff(payload));
    ...
    ;



    The issue is in my test using marbles, I need to be able to check for the anonymous function because dispatchActions is seen as anonymous. How do I do that?



    const values = 
    ...
    b: type: "FETCH_DONE", payload: expected ,
    c: NEEDS TO BE ANONYMOUS
    ;

    ...
    const output$ = fetchApi(action$, state$);

    // This fails due to the anonymous function
    expectObservable(output$).toBe('---(bc)--', values);









    share|improve this question


























      0












      0








      0








      I have the following in an Epic:



      mergeMap(result => concat(
      of(fetchDone(result)),
      of(dispatchActions(payload))
      ))


      And actions:



      const fetchDone = result => ( type: "FETCH_DONE", payload: result );

      function dispatchActions(payload)
      return dispatch =>
      dispatch(doStuff(payload));
      ...
      ;



      The issue is in my test using marbles, I need to be able to check for the anonymous function because dispatchActions is seen as anonymous. How do I do that?



      const values = 
      ...
      b: type: "FETCH_DONE", payload: expected ,
      c: NEEDS TO BE ANONYMOUS
      ;

      ...
      const output$ = fetchApi(action$, state$);

      // This fails due to the anonymous function
      expectObservable(output$).toBe('---(bc)--', values);









      share|improve this question














      I have the following in an Epic:



      mergeMap(result => concat(
      of(fetchDone(result)),
      of(dispatchActions(payload))
      ))


      And actions:



      const fetchDone = result => ( type: "FETCH_DONE", payload: result );

      function dispatchActions(payload)
      return dispatch =>
      dispatch(doStuff(payload));
      ...
      ;



      The issue is in my test using marbles, I need to be able to check for the anonymous function because dispatchActions is seen as anonymous. How do I do that?



      const values = 
      ...
      b: type: "FETCH_DONE", payload: expected ,
      c: NEEDS TO BE ANONYMOUS
      ;

      ...
      const output$ = fetchApi(action$, state$);

      // This fails due to the anonymous function
      expectObservable(output$).toBe('---(bc)--', values);






      redux-observable rxjs-marbles






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 12:30









      NJBNJB

      263 bronze badges




      263 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          As a workaround, I'm doing:



          function dispatchActions(payload) 
          if (payload.callDispatches)
          return dispatch =>
          dispatch(doStuff(payload));
          ...
          ;

          return type: "SOME_TYPE" ;



          Then in the unit test, I just check against the 2nd return. And the if-condition test can just be handled in a separate test outside of marbles.



          This isn't ideal, but solves the issue for now. There should be some way to test redux-thunks using marbles though.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397709%2fhow-do-i-check-for-anonymous-functions%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0
















            As a workaround, I'm doing:



            function dispatchActions(payload) 
            if (payload.callDispatches)
            return dispatch =>
            dispatch(doStuff(payload));
            ...
            ;

            return type: "SOME_TYPE" ;



            Then in the unit test, I just check against the 2nd return. And the if-condition test can just be handled in a separate test outside of marbles.



            This isn't ideal, but solves the issue for now. There should be some way to test redux-thunks using marbles though.






            share|improve this answer





























              0
















              As a workaround, I'm doing:



              function dispatchActions(payload) 
              if (payload.callDispatches)
              return dispatch =>
              dispatch(doStuff(payload));
              ...
              ;

              return type: "SOME_TYPE" ;



              Then in the unit test, I just check against the 2nd return. And the if-condition test can just be handled in a separate test outside of marbles.



              This isn't ideal, but solves the issue for now. There should be some way to test redux-thunks using marbles though.






              share|improve this answer



























                0














                0










                0









                As a workaround, I'm doing:



                function dispatchActions(payload) 
                if (payload.callDispatches)
                return dispatch =>
                dispatch(doStuff(payload));
                ...
                ;

                return type: "SOME_TYPE" ;



                Then in the unit test, I just check against the 2nd return. And the if-condition test can just be handled in a separate test outside of marbles.



                This isn't ideal, but solves the issue for now. There should be some way to test redux-thunks using marbles though.






                share|improve this answer













                As a workaround, I'm doing:



                function dispatchActions(payload) 
                if (payload.callDispatches)
                return dispatch =>
                dispatch(doStuff(payload));
                ...
                ;

                return type: "SOME_TYPE" ;



                Then in the unit test, I just check against the 2nd return. And the if-condition test can just be handled in a separate test outside of marbles.



                This isn't ideal, but solves the issue for now. There should be some way to test redux-thunks using marbles though.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 28 at 15:23









                NJBNJB

                263 bronze badges




                263 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397709%2fhow-do-i-check-for-anonymous-functions%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript