vendredi 3 mars 2017

Assertion Failed: You must use Ember.set() to set the property (of [object Object]) to `[object Object]`

I am trying to integrate a Javascript library I'm building with EmberJS.

Example almost working integration: http://ift.tt/2m6aSyA

The library returns a single object with many nested objects. The library is based on network events, so the child objects are updated periodically without user input. The updated fire events that can be listened to.

This causes problems for EmberJS, because Ember requires every property update to be done via Ember.set() which my library does not use.

The library is a general purpose JS library so I am refusing to add Ember specific code to it. I am wondering how to solve the above error without rewriting my library.

How can I wrap an event based library in a way Ember would like? I have previously tried globals and an Ember service.

In other examples I have seen people wrap every method of the library in Ember specific code. This seems repetitive.

Is it possible to manually tell Ember of changes to the root object and have Ember ignore all other changes? Meaning, can I have ember NOT observe changes and manually tell ember when things change?

The library includes a root event emitter that is notified of all changes to any object within the tree.

ember-cli: 2.11.1
node: 6.7.0
os: darwin x64




Aucun commentaire:

Enregistrer un commentaire