What Is This?
Posterior's simplifies configuration and encapsulation of "AJAX" calls. It takes a structured configuration object and converts it into a hierarchy of logically named functions. Those functions, when called, compose the desired XHR configuration and response handlers and return a Promise. That Promise will resolve (or reject) when all the configured request and response handling has completed.
To achieve better encapsulation, Posterior provides a number of high level features commonly needed for interacting with remote resources. Posterior functions can interpolate URL templates, wait for required dependencies to be resolved, throttle request rates, caching, follow URLS in linked resources, singleton resources, and automatic retry for failed requests.
The intent of this encapsulation is to allow client-side developers to keep implementation details of their interactions with remote servers out of their client-side logic. All translation between the data the client requests/receives and the data the server expects/returns can be hidden behind a friendly, Promise-returning function.
Where Posterior really begins to shine is when the resources being configured are hierarchical, as it makes it trivial to for instances to inherit from and build upon each other by combining and composing properties and functions instead of simply overriding them. Posterior supports special syntax for controlling how properties with the same key are inherited and combined, but in most cases, these are unnecessary.