Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor core to more command-based pattern #31

Closed
mancze opened this issue Nov 16, 2017 · 3 comments
Closed

Refactor core to more command-based pattern #31

mancze opened this issue Nov 16, 2017 · 3 comments
Assignees

Comments

@mancze
Copy link
Collaborator

mancze commented Nov 16, 2017

Current core functionality of the extension is attached as direct handlers of the keymaster events. This causes me problems when debugging/fiddling around with the extension. For example it is not easy to invoke "navigate to the next result" command directly from the developer console.

I would like to refactor the main script of the extension to be more "object" oriented. I think it will provide many benefits aside from what I mentioned. I imagine the core somewhat like:

const extension = {
  options: { },

  init: function() {
    // ...
  },

  commands: {
    focusNextResult: function() {
      // ...
    },
    focusPreviousResult: function() {
      // ...
    },
  }
};

extension.init();

What do you think about this? I would implement that but I want to discuss it first.

@mancze mancze self-assigned this Nov 16, 2017
@infokiller
Copy link
Owner

I think it's a good idea! feel free to send a PR.

@afilp
Copy link

afilp commented Nov 18, 2017

@mancze Great indeed! My plus vote to proceed to a PR if you have the time!

@mancze
Copy link
Collaborator Author

mancze commented Dec 20, 2017

I want just to confirm that I'm still working on this and I'm done with the major part. Now just some final polishing and it will be ready. I must admit I have maybe got I little more involved than needed and the code-base now looks pretty different. Yet I hope it is toward better code organization and reuse.

@mancze mancze mentioned this issue Dec 20, 2017
@mancze mancze closed this as completed Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants