Hello everyone!
So, I have an ember app and I am building a dashboard for the users of the application. My application fetches data from a Rails json-api API ( typical ). So far so good.
The issue I have is that in the dashboard I have charts, tables with data etc which are not related with a specific model in my application. Which is the best way to fetch this data. I tried something like the following at first:
model(params) {
let projects = this.get('store').query('project', {//params//}),
leads = this.get('store').query('lead', {//params//});
return {projects: projects, leads: leads};
}
But in certain occasions the queries might take a long time to run. At the moment I am doing an Ajax call to fetch all the data I need for my charts etc, and in certain components I fetch the data individually inside the component. I understand that this is not the âember wayâ, but it was the best working solution I could come up with.
So my questions are the following:
- Which is the best way to fetch all the needed data for a dashboard ( especially when it is a lot of data ) ?
- How about asynchronous components - routable components? Are they coming in ember ?