Testing promises with Mocha.

In my post about testing with Mocha, I forget a common task in every javascript developer, “the promises”, it is a common task for making our code run async, but how I can test it ?. Feel free to read the code on Github or continue reading. I will write a method that returns a promise and we will…

React Router in 3 minutes

Implement routing into a React app is so easy, the first step is to install react-router -dom package. npm i react-router-dom In the App.js import 3 essentials elements BrowserRouter, Route and Switch from react-router-dom, these handle our routes, create links and load components. import { BrowserRouter as Router, Route, Switch } from “react-router-dom”; Every one…

Vue Router in 3 Minutes

The router is one of the important topics when we build single-page applications with Vue, there are a few things that I wish to know to begin and really helped me get basic tasks with VueRouter. I’m going to assume you’re already working with Vue and want to start to use VueRouter in your existing…

How to add Angular Material in your Angular Apps

Every day we want to create beautiful apps, but we don’t have time to create great interfaces. This kind of situation can be resolved using Angular Material. The Angular Material is a node package created by Angular Team members using Google Material behavior and animations. It brings with some angular components ready to use. Adding…

How to React Type checking

The components in React allow receive data using Props, the props aren’t is strict, that’s mean you can send any type of value, or forget to send some value. In our example, the component Calculator needs 2 props number1 and number2. import React, { Component } from ‘react’; export default class Calculator extends Component { render() { const {…

Why always use arrow functions in Javascript.

Yesterday, I found a good reason to use arrow functions, sometimes I said the arrow functions is a fancy or shorter way to write functions but this is not the only benefit, the Arrow functions can keep the scope of his object without going to the global window, I will explain with code. let paymentmanager = { invoiceId: 1,…