Contentful exports can be bloated. This utility exports Contentful in a simplified result.
- Add the below file to your project and import the utility.
- Install required dependencies:
yarn install dotenv contentful-export
(async () => { | |
const promiseA = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve({data: 'dataA', error: 'errorA'}); | |
}, 2000); | |
}) | |
const promiseB = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve({data: 'dataB', error: 'errorB'}); |
Contentful exports can be bloated. This utility exports Contentful in a simplified result.
yarn install dotenv contentful-export
/** | |
* @module Carousel | |
*/ | |
class Carousel { | |
/** | |
* @classdesc - This module handles all the logic required for the Carousel component | |
* @param {HTMLElement} element - The HTMLElement this module is constructed upon | |
* @param {Object} options - The data attributes on the HTMLElement this module is constructed upon | |
*/ | |
constructor(element, options) { |
// Constants | |
const constants = { | |
attributes: { | |
DATA_TRIGGER: 'data-trigger', | |
DATA_MODAL: 'data-modal', | |
DATA_CLOSE: 'data-close', | |
DATA_IS_OPEN: 'data-is-open', | |
DATA_OVERLAY: 'data-overlay' |
// Helpers | |
const setAsyncTimeout = (cb, timeout = 0) => | |
new Promise(resolve => setTimeout(() => { | |
cb(); | |
resolve(); | |
}, timeout)); | |
// Constants | |
const constants = { | |
attributes: { |
const setAsyncTimeout = (cb, timeout = 0) => new Promise(resolve => { | |
setTimeout(() => { | |
cb(); | |
resolve(); | |
}, timeout); | |
}); | |
// Instead of nesting setTimeout functions... | |
const doStuff = () => { | |
setTimeout(() => { |
As a front-end developer (at ViriCiti) I mostly work on data driven websites/web-applications. One of the things I like to do the most is make something useful for a user out of a big amount of data. It's very rewarding to build a front-end that helps a user understand and gain new insights about this data.
As a student Communication and Multimedia design, or CMD, at the Amsterdam University of Applied Sciences simply building a front-end or data visualization is not all I do. We make user-centric designs. CMD learns you to really think about the user that is going to use your product. I like to bring this mindset to the table in data driven websites/web applications. Far to often the true power of an application doesn't come out because the front-end doesn't appeal to the user's wishes.
The code sprint at Wallscope was a perfect example of this. We could've just started making front-ends and datavis
One of the first features I build was the ability to make calls to the Verinote API, provided by Wallscope, to process inputted text to be then be returned to the client. I build a class that we could use to keep all our data fetching in one central place which we could call in every other file.
Dave Bitter
All examples below our found in the collection on this website.