React/Redux : To make Function Complete update Cache Task before returning Data from Cache The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceWhy do we need middleware for async flow in Redux?How do I access data returned from an axios get to display on a web page using react js?PUT request won't updated data | React, ReduxRedux : New value returned from reducer not updating in StateAPI fetches incomplete data from the server in React JS projectUpdate vue data properties in setTimeout functionBest practice with react redux refreshing data with updated date rangeUnable to access JSON object by property in firebase via axios.getUsing axios to fetch data from an API which has an API attribute in it in reactReact + Axios - Map returns is not a function?

Huge performance difference of the command find with and without using %M option to show permissions

How do you keep chess fun when your opponent constantly beats you?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?

How do spell lists change if the party levels up without taking a long rest?

Do working physicists consider Newtonian mechanics to be "falsified"?

University's motivation for having tenure-track positions

Loose spokes after only a few rides

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Am I ethically obligated to go into work on an off day if the reason is sudden?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

What was the last x86 CPU that did not have the x87 floating-point unit built in?

US Healthcare consultation for visitors

How do I design a circuit to convert a 100 mV and 50 Hz sine wave to a square wave?

Is an up-to-date browser secure on an out-of-date OS?

One-dimensional Japanese puzzle

What's the point in a preamp?

How to type a long/em dash `—`

What is the role of 'For' here?

Is 'stolen' appropriate word?

Example of compact Riemannian manifold with only one geodesic.

Variable with quotation marks "$()"

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?



React/Redux : To make Function Complete update Cache Task before returning Data from Cache



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceWhy do we need middleware for async flow in Redux?How do I access data returned from an axios get to display on a web page using react js?PUT request won't updated data | React, ReduxRedux : New value returned from reducer not updating in StateAPI fetches incomplete data from the server in React JS projectUpdate vue data properties in setTimeout functionBest practice with react redux refreshing data with updated date rangeUnable to access JSON object by property in firebase via axios.getUsing axios to fetch data from an API which has an API attribute in it in reactReact + Axios - Map returns is not a function?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Dynamic Dashboard in React: It has datePicker which allows user to change date and displays data in TreeMap and statistics in Grid Table. Lot of complexities are involved in between but this is the high level goal of the dashboard.



Problem:
When Date is changed from DatePicker, appropriate action function is called which calls API class that has axios.get() call to get data from API. That in turn calls other class which pass parameters and cache to another function to get the data. Inside that function which gets all the data Update() method is called which calls the actual URL with parameters and stores the response in jsons into array.



Issue:
Inside the getData() and UpdateData() function the part which gets the data from cache is called first before completing the update of data for new date.



Ideal Flow:
getData - Calls updateData
updateData - Has code to update Cache and get data from Cache.
updated Cache - should be called first.
GetData from Cache - should be called after that.



Solution:
1. I have tried setTimeout() but it increases response time to load page
2. Used await with async but it does not help.



Using:
Axios() from 'axios'
getSecure() from 'httpClient'



Basically i want to make update function complete and then call getData part from Cache.



Let me know if you need more details.










share|improve this question
























  • Basically, I want to make update Task thing complete fully before get Data thing is called.

    – Manisha Mulchandani
    Mar 12 at 13:02

















1















Dynamic Dashboard in React: It has datePicker which allows user to change date and displays data in TreeMap and statistics in Grid Table. Lot of complexities are involved in between but this is the high level goal of the dashboard.



Problem:
When Date is changed from DatePicker, appropriate action function is called which calls API class that has axios.get() call to get data from API. That in turn calls other class which pass parameters and cache to another function to get the data. Inside that function which gets all the data Update() method is called which calls the actual URL with parameters and stores the response in jsons into array.



Issue:
Inside the getData() and UpdateData() function the part which gets the data from cache is called first before completing the update of data for new date.



Ideal Flow:
getData - Calls updateData
updateData - Has code to update Cache and get data from Cache.
updated Cache - should be called first.
GetData from Cache - should be called after that.



Solution:
1. I have tried setTimeout() but it increases response time to load page
2. Used await with async but it does not help.



Using:
Axios() from 'axios'
getSecure() from 'httpClient'



Basically i want to make update function complete and then call getData part from Cache.



Let me know if you need more details.










share|improve this question
























  • Basically, I want to make update Task thing complete fully before get Data thing is called.

    – Manisha Mulchandani
    Mar 12 at 13:02













1












1








1








Dynamic Dashboard in React: It has datePicker which allows user to change date and displays data in TreeMap and statistics in Grid Table. Lot of complexities are involved in between but this is the high level goal of the dashboard.



Problem:
When Date is changed from DatePicker, appropriate action function is called which calls API class that has axios.get() call to get data from API. That in turn calls other class which pass parameters and cache to another function to get the data. Inside that function which gets all the data Update() method is called which calls the actual URL with parameters and stores the response in jsons into array.



Issue:
Inside the getData() and UpdateData() function the part which gets the data from cache is called first before completing the update of data for new date.



Ideal Flow:
getData - Calls updateData
updateData - Has code to update Cache and get data from Cache.
updated Cache - should be called first.
GetData from Cache - should be called after that.



Solution:
1. I have tried setTimeout() but it increases response time to load page
2. Used await with async but it does not help.



Using:
Axios() from 'axios'
getSecure() from 'httpClient'



Basically i want to make update function complete and then call getData part from Cache.



Let me know if you need more details.










share|improve this question
















Dynamic Dashboard in React: It has datePicker which allows user to change date and displays data in TreeMap and statistics in Grid Table. Lot of complexities are involved in between but this is the high level goal of the dashboard.



Problem:
When Date is changed from DatePicker, appropriate action function is called which calls API class that has axios.get() call to get data from API. That in turn calls other class which pass parameters and cache to another function to get the data. Inside that function which gets all the data Update() method is called which calls the actual URL with parameters and stores the response in jsons into array.



Issue:
Inside the getData() and UpdateData() function the part which gets the data from cache is called first before completing the update of data for new date.



Ideal Flow:
getData - Calls updateData
updateData - Has code to update Cache and get data from Cache.
updated Cache - should be called first.
GetData from Cache - should be called after that.



Solution:
1. I have tried setTimeout() but it increases response time to load page
2. Used await with async but it does not help.



Using:
Axios() from 'axios'
getSecure() from 'httpClient'



Basically i want to make update function complete and then call getData part from Cache.



Let me know if you need more details.







reactjs redux axios wait synchronous






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 12:08







Manisha Mulchandani

















asked Mar 8 at 11:12









Manisha MulchandaniManisha Mulchandani

64




64












  • Basically, I want to make update Task thing complete fully before get Data thing is called.

    – Manisha Mulchandani
    Mar 12 at 13:02

















  • Basically, I want to make update Task thing complete fully before get Data thing is called.

    – Manisha Mulchandani
    Mar 12 at 13:02
















Basically, I want to make update Task thing complete fully before get Data thing is called.

– Manisha Mulchandani
Mar 12 at 13:02





Basically, I want to make update Task thing complete fully before get Data thing is called.

– Manisha Mulchandani
Mar 12 at 13:02












0






active

oldest

votes












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/3.0/"u003ecc by-sa 3.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%2f55062015%2freact-redux-to-make-function-complete-update-cache-task-before-returning-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















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%2f55062015%2freact-redux-to-make-function-complete-update-cache-task-before-returning-data%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

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved