glue-command
Together with the glue-request-dispatcher element, glue-command
lets you expose a service or command (such as making an AJAX call) and call it from anywhere within your application. Use the glue-request-dispatcher
to call the command, and glue-command
to provide the implementation. The elements can exist anywhere within the DOM and are entirely decoupled.
When triggering a request using a glue-request-dispatcher
, you're provided with a promise for the result. This then makes it easy to make multiple simultaneous requests, or chain them in sequence.
See the component page for more information.