afterglowtech / angular-detour

Lazy-loaded/runtime-configurable/server-enhanced routing for AngularJS applications
Other
51 stars 5 forks source link

$http interceptors? #19

Open laurelnaiad opened 11 years ago

laurelnaiad commented 11 years ago

Consider using http interceptors to get updates during regular requests.

basic idea:

request interceptor adds serial #. server checks if updates are available, if so sends back "do updates message". response interceptor sees that updates are necessary, adds request for updates to original request along with known states. new response includes routing updates and original response response interceptor handles the routing updates, then allows application to process the response as normal

if there are no updates, then minimal cost

value -- obviates need for client app author to worry about updates unless they need them to happen without the user doing any $http requests to the server implications -- implies that the web app and backseatDriver are integrated (one proxies the other or one is a module of the other)

this may not be worth the trouble, so hold off for now...