Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

enhancement(refactor): Minor refactor in .vue and .js files #39

Merged
merged 3 commits into from
Feb 22, 2018
Merged

enhancement(refactor): Minor refactor in .vue and .js files #39

merged 3 commits into from
Feb 22, 2018

Conversation

guastallaigor
Copy link
Contributor

@guastallaigor guastallaigor commented Feb 21, 2018

I did some minor refactoring in your code, i think it looks a little better. If you don't want to merge that's not a problem :)

  1. Changed how the files are imported: ../../ to @;
  2. Added a tab space Inside every <script> tag;
  3. Changed import Vuex from 'vuex' to import { mapGetters, mapActions } from 'vuex';
  4. Added mapActions in every folder that used this.$store.dispatch and changed that to just the method call.
  5. Added blank line before ifs and after sometimes;
  6. Added blank line before returns;
  7. Removed some unused methods and objects inside each .vue component;

After this minor refactoring I tested it all manually.

Suggestions:

  • You should also consider start using mapState. In my personal opinion it looks better than using getters inside store.js files.
  • The three file folder it looks good but I think you should consider stop using for all the components, like smaller ones. It may change the architecture consistency, but sometimes the component it just small and you had to create a folder and 3 files, like in Editor.vue or HelpTokenModal.vue.

Change ../../ to @. Change indentation. Change the import Vuex to import only the maps you want. Added mapActions to use instead of this.$store.dispatch.  Added blank lines before each ifs and returns and after some ifs. Removed some unused methods and objects. Removed some blank lines.
@guastallaigor guastallaigor changed the title Minor refactor in .vue and .js files enhancement(refactor): Minor refactor in .vue and .js files Feb 21, 2018
@lauthieb
Copy link
Owner

Thanks @guastallaigor for this PR !
I will test it and if it's ok for me, I will accept it ;)

Merge request corrections, change the name of some methods because was overriding the methods of mapActions from Vuex. Airbnb lint corrections. One tab space inside <script> tag.
@lauthieb lauthieb merged commit 6144f5e into lauthieb:master Feb 22, 2018
@lauthieb
Copy link
Owner

Thanks a lot for you help @guastallaigor 😄

@guastallaigor guastallaigor deleted the code-js-refactor branch February 22, 2018 21:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants