samedi 29 juillet 2017

Ember add-ons: what is the recommended way to handle input data?

When writing a (public) ember add-on; what is the recommended format for input data coming from the main ember app? Do you expect ember-data objects, or a simpler data model such as an array for example?

If the add-on accepts ember data objects; any modifications to this data can be persisted to the backend easily, but I'm certain that not everyone uses ember-data. If you don't use ember-data, converting a data model into ember-data's formats is madness.

On the other hand, if the add-on accepts an array (for example) as the input data, then the main ember app using ember-data has to extract the data into this array format for the add-on to use.

I haven't seen any guidance in the Ember docs or elsewhere in the web that I could find.




Aucun commentaire:

Enregistrer un commentaire