Confirmed users
67
edits
Aamariutei (talk | contribs) No edit summary |
|||
Line 288: | Line 288: | ||
and add "Foo" to the <tt>services.sync.registerEngines</tt> preference (it's a comma separated list of engine names). | and add "Foo" to the <tt>services.sync.registerEngines</tt> preference (it's a comma separated list of engine names). | ||
You can also set up a component that registers a weave:service:ready observer and at that time, imports main.js as well as your engine. Also, for me, doing Weave.Engines.register(FooEngine) worked better then doing Weave.FooEngine = FooEngine. Reason for this is, Weave will iterate through the registerEngines preference and try to instantiate each engine it has there before you the line mentioned above ever has a chance to execute.This means the constructor to your engine is not ready when Weave tries to instantiate it. | |||
== Testing and Debugging your Engine == | == Testing and Debugging your Engine == | ||
Set observers in the Tracker to tell when your datatype changes, after which the score needs to be set. You can also add api's to the engine, get a handle of the engine by going Weave.Engines.get("Foo") and call it directly. |