Last active
February 24, 2019 21:43
-
-
Save Lackoftactics/01dafc8fec3a3130000402258cb3f04a to your computer and use it in GitHub Desktop.
Code review part I
This file contains hidden or 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
<div class="row"> | |
{{ $t("WIND") }}: | |
{{ | |
** This ternary operator looks weird here, logic should be probably moved to function ** | |
getWindDirection(weather.wind ? weather.wind.direction : 400) | |
}} | |
| {{ weather.wind ? weather.wind.speed : "n/a" }}m/s | |
</div> |
This file contains hidden or 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
** Would think about naming more appropiate than array. chartData? | |
get chartDataComputed() { | |
let array = []; | |
array.push(["Hour", "Temperature"]); | |
array.push( | |
...(this.weather.forecast || []).map(f => { | |
return [f.time, f.temp]; | |
}) | |
); | |
return array; | |
} |
This file contains hidden or 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
import Vue from "vue"; | |
import App from "./App.vue"; | |
import router from "./router"; | |
import VueI18n from "vue-i18n"; | |
Vue.use(VueI18n); | |
import VueGoogleCharts from "vue-google-charts"; | |
Vue.use(VueGoogleCharts); | |
import { languages } from "@/i18n"; | |
import { defaultLocale } from "@/i18n"; | |
const messages = Object.assign(languages); | |
Vue.config.productionTip = false; | |
var i18n = new VueI18n({ | |
locale: defaultLocale, | |
fallbackLocale: "de", | |
messages | |
}); | |
new Vue({ | |
router, | |
i18n, | |
render: h => h(App) | |
}).$mount("#app"); | |
** Good practice to import at the styles? ** | |
import "fomantic-ui-less/semantic.less"; | |
This file contains hidden or 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
export class SingleDayForecast { | |
** Why Date as string? You don't need any manipulations? ** | |
date?: string; | |
averageWeather?: Weather; | |
forecast?: Array<Weather>; | |
} | |
const requestUrl = | |
** WHY NOT USE String interpolation?? ** | |
API_URL + "?id=" + cityId + "&units=metric" + "&APPID=" + API_KEY; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment