Skip to content

Instantly share code, notes, and snippets.

View andrecbr's full-sized avatar

Andre andrecbr

  • Blumenau, SC, Brazil
View GitHub Profile
@andrecbr
andrecbr / promiseCatchWithAwait.js
Created July 15, 2020 11:49 — forked from dbayarchyk/promiseCatchWithAwait.js
Async/await without try/catch in JavaScript
async function fetchAndUpdatePosts() {
const posts = await fetchPosts().catch(() => {
console.log('error in fetching posts');
});
if (posts) {
doSomethingWithPosts(posts);
}
}
@andrecbr
andrecbr / git-conventional-patterns.md
Last active March 17, 2020 11:33
Patterns and Conventional Git Commit Message

Format of the commit message:

<type>(<scope>): <subject>

Example commit message:

fix(middleware): ensure Range headers adhere more closely to RFC 2616 Closes #4, #6, Related to #5

<type> values:

  • feat (new feature for the user, not a new feature for build script)
  • fix (bug fix for the user, not a fix to a build script)
  • docs (changes to the documentation)

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example