- Briefly, it takes two arrays: (the string constants ) and (the templated string values that need to be encoded ).
- It is passed an array of strings, but what I’m calling an array of values, is actually a variable number of arguments.
- I’m using ES6 “rest” syntax to convert the arguments into an array of values.
- When we reduce over strings, the zeroth element of the strings array is passed as partialUri and iteration starts with the first element, and so on.
- It’s a special form of the ES6 template literal that we used above, but it allows us to process it with a function.
A while back while writing a React application that hit a REST endpoint, I wrote a little utility to build a properly encoded Uri path. At the time, I didn’t think much about it. It did the job and I moved on.
- DYI content management system with Firebase ReactHow I built a Content Management System for a React app in one dayFirebase + React = Quick DIY CMSThere are two ways of handling website content:Use a CMS.Hard code in the copy/image urls in the code itself.Option number 2 quick at first, and is fine…
- However, two big problems will surface and grow as companies scale.In fact, I have personally experienced multiple times the first of these two problems at work.Problem 1: time wasted by engineerEvery time there needs to be a content change, the product team would need to ping an engineer, and the engineer…
- This will definitely be a problem if the company ever goes international in non-English speaking countries.SolutionThe solution to these two problems is a good content management system.Pillow, where I’m currently working, had a Hackathon last week.
- Anyone can signup for an account with their gmail, create a project, and add data to the database.Because of the NoSQL structure, I thought it would be a great way to store website copy.
- This is what I did to structure Pillow’s landing page copy during the Hackathon:Screenshot of json data structurePillow’s website is already built with React, and that made my job a lot easier.All I needed to do on that front is install re-base, set up some configuration, and replace the hard…
Option number 2 quick at first, and is fine for an early stage startup operating in one country. However, two big problems will surface and grow as companies scale. Every time there needs to be a…
Continue reading “How I built a Content Management System for a React app in one day”