Closed jscott0918 closed 9 years ago
:+1:
itd be cooler if you used:
chrome.storage.sync.get('league_settings', function(settings)
{
//if empty, make request for settings
if($.isEmptyObject(settings))
{
$.get('http://games.espn.go.com/ffl/leaguesetup/sections/scoring', {"leagueId": league_id}, function(d) {
parse_data(d);
});
}
else //push settings local
{
window.league_settings = settings['league_settings'];
getPosProjections();
}
});
reference: https://github.com/trippedout/FantasyPlus/commit/d233d568d1892db14a1561f0ffc8f9467ef129bb
so that we can keep it synced across our devices/browsers :D
Hmmm...is it possible to combine these two? In @jscott0918 version, I think getPosProjections can actually execute before the data is parsed the first time, but it has the added benefit of checking for updated league settings. I don't want it to redraw on that second check. But @trippedout seems a bit cleaner, though without ever changing it in the future. Any ideas? I haven't had my coffee yet today.
Hopefully this will result in less upfront network traffic waiting for rules to reload.