Monday, March 30, 2020

Async requests using ionic-native/http

Android has been locking down the security within chrome, making cross-origin requests far more complicated within cordova applications. As a result a good alternative to use is a native plugin such as the @ionic-native/http or cordova-plugin-advanced-http. Unfortunately, this gives you a method that is dependent upon callbacks rather than one that can be used asynchronously.

The good news is that you can fix this by wrapping the method in a promise as show below.

import {HTTP} from '@ionic-native/http'
const asyncHTTP = (url) => {
return new Promise((resolve, reject) => {
HTTP.get(url, {}, {},
(response) => { resolve(response.data); },
(response) => { reject(response.error); })
})
}



from news.ebscer.com

Labels:

Thursday, February 27, 2020

Coding with Ligatures

A little over a month ago Daring Fireball linked to a new monospaced font with support for coding optimized ligatures. I was already using a JetBrains IDE for my primary development at work so I decided to give it a try, and one month in I am really liking it.

Some of the ligatures such as => are purely cosmetic changes, but others such as the greater or equal symbol and the less than or equal to symbol are much easier to read. The font has been designed with care to the point where even differentiating between === and == is easier with ligatures enabled. The only symbol I am not yet sold on is the one for != which is easy enough to read, but so different from how it is typed that it slows me occasionally.

Overall I finding viewing my code through these ligatures to be an improvement, and plan to keep on using them in any development environment where they are supported.



from news.ebscer.com

Labels: