flex 3 order of component loading - flex3

i have a custom component (AS3 component) which i include in my main.mxml. The problem is that it takes a bout 2 seconds longer than the main page to load. It has a db call which casues the delay.
how can i fix this so that my custom component is loaded and displayed at the same time as my main.mxml file
this is my component include ;
<comp:InputFieldGenerator>

If you're waiting for some asynchronous operation (e.g. a RemoteObject call) to complete, you could wrap your "main page" in a container, set its initial visibility to false and only flip it when your operation completes. You can also use states in your main.mxml for the same effect.

Related

Manually Loading Deferred slot/components in spartacus

I ran into an issue, my lazy loaded PDP module having issue with deferred loadingof componnets
I used deferLoading: DeferLoadingStrategy.INSTANT but didnt work.
actually,I want to scroll down to a slot by clicking on button in top of the screen, like for review/rating componnets from top to bottom scroll.
Can I load deferred slot/components using any service on button click ?
INSTANT is the default deferred loading configuration. If you are specifically working on the review/rating component, you might want to look into the above-the-fold loading
More information can be found here - https://sap.github.io/spartacus-docs/above-the-fold/

How to control the flow of Rendering in React Native

Let say I have a screen like this, Component B and its content is so large that may cause entire screen to wait 2 sec to render.
I'm wondering is there any way to delay the render of componentB until compA finish?
I've heard about Interaction Manager, can it use in this situation?
you can Use state for handle it and Use Dialog component for loading Screen , when your data load complete set your state for Hidden the Loading Screen:) if it's helpful please add point .

setTimeout inside component is getting called regardless of page

I have a setTimeout call that gets called every 5 minutes. The issue is that no matter what page I am on, the timeout is still getting called and is making api calls.
My setTimeout component is inside the home page, what would be ideal is killing just that component when no longer on the home page. I would like to avoid destroying the homepage component and not having to refetch data.
My setTimeout code is like this:
sendCords(){
this.props.actions.findCords()
this.beginTimeout()
}
beginTimeout(){
let timer = setTimeout(this.sendCords,300000);
this.setState({timer});
}
Note: Lifecycle hooks E.G. componentWillUnMount is not getting called, as the pages are like a stack - and the pages are not un-mounting. I am using react-native-router-flux
Any help would be much appreciated.
Well I ended up having to do a few things, in my actions I would check what page I was calling and dispatch an empty action if It was not called on the homepage. This would trigger a the clear timeout. Having a force refresh on my component was needed
<Comp refresh={() => this.setState({val:!this.state.val} />
And I would then I have a shouldComponentUpdate used like so when navigating back to the home page and needing to set the timeout again:
shouldComponentUpdate(nextProps, nextState){
if(this.props.removeTimer && !nextState.removeTimer){
this.timeOutFunc()
}

Browser freezes for 4-5 seconds until Vue component finishes loading

I have a Vue component: task.vue which generates a list of tasks, and an epic.vue component which is the parent of task.vue, so for each epic.vue I generate it's tasks list from task.vue.
The problem is that when I reload the page, the browser freezes for 4-5 seconds until the task.vue component renders completely.
Everytime I reload the page I have an ajax that fetches all the data from an api function. It returns a nested array containing epics(folders in folders), each with it's own set of tasks. It is indeed a big array, could contain 1000+ records.
Is there a way to fix the freezing of the browser while the task.vue component loads ?
In my epic.vue I simply pass a prop to task.vue component containing all the task that current epic has.
My array structure and vue rendering is exactly like: https://vuejs.org/examples/tree-view.html.
If the loading time is directly related to the number of records you're loading then you could consider loading an initial chunk (e.g. 100 or so) to allow for a quick render and then lazy load the rest in immediately or as needed in same-sized chunks.

DurandalJS - Why are transitions not starting right away when a user navigates

Could someone explain why the transitions (at least the default one - entrance) are not starting right away when a user clicks on a link (navigate) with Durandal?
In other words, do we need two mechanisms (loader animation + transition) to indicate that there is an action underway (ex. ajax call inside the activate method).
I'm sure there's a good reason, or maybe I just have to modify the entrance transition?
It seems like Durandal's transitions run once the activate function resolves. I asked a similar question where I enumerated some of the possible solutions that I found which worked for my situation specifically:
Manually animate away every view in its deactivate() and animate it back in via its viewAttached()
Bind the .page-host div's visibility to router.isNavigating (using a custom binding to handle the transition such as the fadeVisible example from the knockout site)
Manually subscribe to router.isNavigating and run custom logic when it changes
Hopefully this helps.
If you did not compress your entire application then the first process will be requirejs downloading the next amd module and then downloading the appropriate view.
The next step is durandal calling activate on your module. Activate if it returns a Deferred then it will wait for the deferred to complete.
Once activate is complete then the transition is called. The transition is responsible for swapping out the old view for the new one.
So, if its taking a while to kick off the transition its probably because its lagging in downloading your module and view.. or your activate method is taking a bit of time to finish.