Getting, Setting, and Understanding Web Cookies using Express and WebdriverIO

Cookies, both the tasty kind and the web browsing kind, aren’t new to me. I’ve clicked my fair share of “this site uses cookies” pop-ups, but until recently, I hadn’t encountered cookies in my work as a programmer.

Being newly tasked with the configuration and testing of cookies, I realized that, although cookies are ubiquitous on the web, I had glossed over several important aspects. While trying to fill in the gaps in my understanding, I had a hard time finding a source that answered all of my cookie-related questions. I hope that this blog post will serve as that resource for others. Read more on Getting, Setting, and Understanding Web Cookies using Express and WebdriverIO…

Reactive Programming: A Timed Popup Component with RxJS

Reactive programming is all about streams. It involves combining streams, filtering streams, and transforming streams. In reactive programming, the application does not need to pull for data, but it is notified whenever a new event occurs.

A few months ago, I wrote a post on reactive programming in WPF using ReactiveUI. Recently, we’ve been working on an Angular project and have been using the RxJS library for reactive programming in JavaScript. RxJS follows the reactive programming pattern of observers consuming data by subscribing to the observables. It also implements a set of operators such as map, filter, and reduce, which (generally speaking) take an observable, mutate it in some way, and then return the mutated observable. Read more on Reactive Programming: A Timed Popup Component with RxJS…

Four Hurdles when Prototyping with Material-UI for React

Google created the Material Design design language to be used across devices. If you’re using Material Design with React, I’d recommend Material-UI for React to get the ball rolling. It’s a library of components or pre-styled elements (similar to the Bootstrap framework) that are easy to add to a page, and the components look and function well out of the box. Read more on Four Hurdles when Prototyping with Material-UI for React…

Managing Data Loaders in Node.js with Shared State

When developing software, it’s always tough to work with caching. While my team appreciates the efficiencies that Data Loader can provide for applications, we still struggle with the same problems that always come up when caching queries, mainly invalidating caches when a data set has changed. Read more on Managing Data Loaders in Node.js with Shared State…

Understanding the Apollo Default Resolver

According to documentation for Apollo’s GraphQL-tools:

You don’t need to specify resolvers for every type in your schema. If you don’t specify a resolver, GraphQL.js falls back to a default one…

The documentation goes on to state that the default resolver will look for a property on the parent object with the field name that’s being resolved. If that property is not a function, the value of the property is returned. But if the property does contain a function, then the default resolver calls it, and “passes the query arguments into that function.”

It wasn’t clear to me exactly what this meant, so I did some experimenting. Read more on Understanding the Apollo Default Resolver…

A JavaScript Object that Dynamically Returns Unknown Properties

In our current project, we make extensive use of JavaScript objects as dictionaries, with the property name functioning as a key for the object we want to look up. We can use the in operator to test for property presence, and the dictionaries are perfectly JSON-serializable.

However, when it comes time to build test fixtures around these dictionaries for testing code that might look up lots of different keys, creating the test data for all of these keys becomes a large effort. Read more on A JavaScript Object that Dynamically Returns Unknown Properties…