SpineEventEngine / web

Spine web server and JS client library.
https://spine.io
Apache License 2.0
1 stars 3 forks source link

Simplify specifying entity type information in spine-web-client's API #30

Open dpikhulya opened 6 years ago

dpikhulya commented 6 years ago

Problems in the current API

Specifying entity/message types in spine-web-client's public API methods is currently very complicated.

Usage examples of the current API:

The way this is currently worked around

We currently try to solve this on the side of License Server application by introducing utilities (1, 2) for creating these structures of instances, but we still need to provide additional data that could ideally be not needed (type names, type URL prefixes).

The preferred solution

This request is to make such usages as simple as possible. Here's what the above examples could ideally be like:

   this._productViewsPromise = backend.fetchAll({
     ofType: ProductView
   }).atOnce();

and for sending a command:

   backend.sendCommand(createSingleDevLicenseCommand, ...commandCallbacks);
armiol commented 6 years ago

@dpikhulya FYI, let's discuss, once Firebase test-related issue is resolved.