URLs building for the API'sIf you find yourself in this case: const API_URL = 'https://api.example.com/'; function getUserPosts(id, blogId, limit, offset) { const requestUrl = `${API_URL}/users/${id}/blogs/${blogId}/posts?limit=${limit}&offset=${offset}`; // send HTTP req...Oct 14, 2020 · 1 min readelectron.hashnode.dev
JS Date management - date-fns.jsI think the time had come to drop moment.js. And when saying that is because I found something a bit more convenient and lightweight: https://date-fns.org/ And I like the API, which sounds as: const today = new Date(); console.log( lastDayOfMonth(to...Oct 14, 2020 · 1 min readelectron.hashnode.dev
Vue and ReactHi all! I am a Vue.js ecosystem web dev, with 3+ more experience in Vue.js. I have started the tutorials of React.js with Mosh which explains very very well the library, and if it would be to compare the two so far, I would say the following. Note: ...1AOct 14, 2020 · 2 min readelectron.hashnode.dev
Disable the autocomplete ChromeI get this annoying helping functionality of Google Chrome browser in what regards the forms: it auto-fills with predefined stored/cached data even if I specify clearly autocomplete="off/none" HTML attribute. There are cases when I really want the f...1SOct 14, 2020 · 1 min readelectron.hashnode.dev
Recurring object properties - JSIf you ever get into troubles (and I'm sure you did) when trying to access a property of a JS object which does not exist twice, you will definitely get the red alert in the console. Example: const obj = {}; console.log(obj.foo.bar); In order to f...Oct 14, 2020 · 1 min readelectron.hashnode.dev