reflow.js 893 B

123456789101112131415161718192021222324252627282930
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const {reflowSpec} = require("devtools/shared/specs/reflow");
  6. const protocol = require("devtools/shared/protocol");
  7. /**
  8. * Usage example of the reflow front:
  9. *
  10. * let front = ReflowFront(toolbox.target.client, toolbox.target.form);
  11. * front.on("reflows", this._onReflows);
  12. * front.start();
  13. * // now wait for events to come
  14. */
  15. const ReflowFront = protocol.FrontClassWithSpec(reflowSpec, {
  16. initialize: function (client, {reflowActor}) {
  17. protocol.Front.prototype.initialize.call(this, client, {actor: reflowActor});
  18. this.manage(this);
  19. },
  20. destroy: function () {
  21. protocol.Front.prototype.destroy.call(this);
  22. },
  23. });
  24. exports.ReflowFront = ReflowFront;