-
Notifications
You must be signed in to change notification settings - Fork 286
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
- WIP, Refactorring. #370
- WIP, Refactorring. #370
Conversation
_connect: function() { | ||
let self = this; | ||
|
||
_connect: () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be _connect() {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ops, I actually wanted to restore it to it's original state, Any functions with a trailing .
(eg .on()
, .property()
etc) gives me an error (unexpected .
) when trying to refactor them!
Any workaround/suggestion for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should stop using .on
and .property
.
const { on, computed } = Ember;
_connect: on('init', function() {
}),
myProp: computed('key1', 'key2', function() {
return this.get('key1') + this.get('key2);
})
87c108d
to
c401fb3
Compare
Ok, I think now this PR is ready.. |
@@ -1,27 +1,28 @@ | |||
import BasicAdapter from "./basic"; | |||
import Ember from 'ember'; | |||
const { on } = Ember; | |||
|
|||
export default BasicAdapter.extend({ | |||
name: 'bookmarklet', | |||
|
|||
inspectedWindow: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
computed(
@Mawaheb Nice work, this is almost ready! Left some comments. Leaving the new method definition syntax to another PR is a good idea. |
c401fb3
to
edc1a58
Compare
@teddyzeenny thank you for the feedback, I modified the file accordingly :), Further notes, suggestions are always welcome. |
- WIP, more refactoring - Minor edits. - Refactor the remaning properties.
edc1a58
to
5d27b03
Compare
Looks good! @Mawaheb that's how I would handle both cases. |
This PR, is made to see If I am on the right direction, Doing the right thing, and to hear any advice, suggestions, comments.
This is a WIP, Refactoring the code to use arrow functions and the new functions definition syntax on properties.
@teddyzeenny Please let me know what do you think.