Maximum call stack size exceeded - Mobile App

Maximum call stack size exceeded - Mobile App

  

Hi, 

I am getting "Maximum call stack size exceeded" error while calling a function recursively, using follwoing JS.

setTimeout($actions.OnInitialise(),10000);

How can I refresh my client action in span of a few seconds?

Sachin

Hello Sachin

Why do you need to refresh at this high rate?

Cheers,

Eduardo Jauch

Eduardo Jauch wrote:

Hello Sachin

Why do you need to refresh at this high rate?

Cheers,

Eduardo Jauch

Hi Edurado,

I was trying to implement one plugin which can shows user's foot count while he/she is walking. In order to get updated count I need to refresh my action.

Sachin


Ok. But why are you calling OnInitialize?

As mobile uses React, should be enough to call a client action that updates the variable used in the count...

Eduardo Jauch wrote:

Ok. But why are you calling OnInitialize?

As mobile uses React, should be enough to call a client action that updates the variable used in the count...

Yes, I understand but how to call that function so that it updates the variable and refresh the expression which is bind with that count variable.

Sachin


Hi Sachin,

The same way. :)

Using $actions.yourclientaction

Let me do a test here :)

Solution

Put a JavaScript node in the OnReady (for example) with the following code:

function UpdateCounter() {
    $actions.UpdateClientAction();
    setTimeout(xyz,1000);
}
UpdateCounter();

This way the Stack limit will not happen (I think).

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Put a JavaScript node in the OnReady (for example) with the following code:

function UpdateCounter() {
    $actions.UpdateClientAction();
    setTimeout(xyz,1000);
}
UpdateCounter();

This way the Stack limit will not happen (I think).

Cheers,
Eduardo Jauch

Thanks Edurado, 

Finally, It worked out. Thank you so much for helping me.

Sachin