Tidy SQLite statements with JS Template Literals
While reviewing an open source React Native project I’d worked on recently, I was surprised with how difficult I found parsing the SQLite statements that I’d written in JavaScript. It seemed that my best efforts of breaking a long statement into multiple lines had added a number of characters which negatively affected the human readability of the code. Take the following CREATE TABLE
statement as an example:
Using SQLite Dates in a React Native app
When I first began working with SQLite I was surprised to learn that there was no DATE
or DATETIME
datatype equivalent. Instead, time-based data must be stored as INTEGER
, TEXT
or REAL
types. But, how can you logically order a TEXT
-based date? How can you move seamlessly between Moment.js on the clientside and these primitive types in SQLite? Read on!
Building a responsive table in React Native with Hooks
This post details a technique that you can use in a dual orientation app to render more (or less) data in your tables–as space permits—using a couple of simple hooks. Keeping in mind that the last thing our app users want is to be unable to access the data they’re looking for, we’ll provide a hint showing how they can rotate their device to reveal even more.
React Ottawa: Dealing with Monetary Values
I gave a talk at the April 2019 installment of the Ottawa React meetup on the topic of “Dealing with Monetary Values in React.” I had so much fun putting together this talk; from hours spent digging through my folks’ photo archives for a picture of me working at Tim Hortons, to building a working replica of the cash register I remember from 16 years ago. The slides don’t really stand on their own so I thought I would put together a short post with links to a few resources.