packageglue.js 816 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use babel';
  2. import { CompositeDisposable } from 'atom';
  3. import { pas, rtl } from './pas2jsdemopackage.js';
  4. export default {
  5. activate(state) {
  6. rtl.run();
  7. this.subscriptions = new CompositeDisposable();
  8. this.atomEnv = {
  9. atomGlobal : atom,
  10. subscriptions : this.subscriptions,
  11. initialState : state
  12. }
  13. this.atomHandler = {
  14. onDeactivate : function (a) {},
  15. onSerialize : function (a,o) {}
  16. }
  17. pas.program.InitAtom(this.atomEnv,this.atomHandler);
  18. },
  19. deactivate() {
  20. if (this.atomHandler.onDeactivate) {
  21. this.atomHandler.onDeactivate(this.atomEnv)
  22. }
  23. this.subscriptions.dispose();
  24. },
  25. serialize() {
  26. var obj = {};
  27. if (this.atomHandler.onSerialize) {
  28. this.atomHandler.onSerialize(this.atomEnv,obj)
  29. }
  30. return obj;
  31. }
  32. };