Utilize "Data Mapping" Feature with input from Local Storage
Hi,
Am trying to optimize our application a bit from the perspective of minimizing
REST calls. As an example, we have a login page, where upon the user clicking
on the "Login" button we make a REST call to authenticate. If the REST service
succeeds, we transition to another page ("Home" page) and make another REST call (returns a list of stuff) to populate this page (display a list of stuff).
What we would like to do is eliminate one REST call in the above use case, where our initial authenticate REST call would be modified to return a "list of stuff" that could be used to populate the "Home" page. How could we achieve this? Initial thoughts would be have pseudo-code like this:
Custom JavaScript for Login Button Click Event
----------------------------------------------Login.execute({});
if (successful) {
store the "list of stuff" json in local storage
transition to "Home" Page
} else {
alert('unable to authenticate');
}
Custom JavaScript for "Home" Page "Load" Event
----------------------------------------------retreive "the list of stuff" json from local storage (see above Custom JavaScript)
call some tiggzi internal so that we do not make a REST call, but are able to re-use the "Data Mapping" that is defined for the call we do not make anymore
I guess the big question is, is there away to utilize the "Data Mapping" feature that Tiggzi provides but decouple it from a REST call and as a replacement provide the "Data Mapping" feature a json object/list that is in local storage?
If the above pseudo-code is possible, what would the proper API calls be?
Al