Created
March 5, 2017 00:22
-
-
Save Yarkhan/d21b2c00f12f548fbf4c37cf71e8f992 to your computer and use it in GitHub Desktop.
Returning Object Literals from arrow functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Instead this | |
{ | |
data: () => { | |
return { | |
id: 1, | |
name: "John Snow" | |
} | |
} | |
} | |
//Do this | |
{ | |
data: () => ({ | |
id: 1, | |
name: "John Snow" | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment