HOC

A Simple higher order Component example

I have been factoring my code and have decided that I need to build a few higher order components.

Why?

I have four components that are very similar and all require some data manipulations to be carried out on the props so I figure I can remove all this duplication with a higher order component that takes in the props , runs some functions and then presents the updated props to the components.

What I have done

To help me get my head around higher Order Functions I created a simple example and have put it into codesandbox.

AppSwitcher.js

I have also created a component called AppSwitcher.js that toggles between the app and specific components I am developing. I have found that this can be quite helpful for sandboxing new things in my app and thought I’d include it here in case anyone else find it useful. The flow of the app is like this

index.js -> AppSwitcher -> App.js or {Components to be tested}

MERN-APP

Modern Apps are complicated

After about 7 months I am getting close to understanding enough to be completing the first version of Infoshot.

I was expecting to be here sooner and have been surprised how complicated building one app is nowadays. So different from 1996 when I built “Detroit Underground” in php and html.

There are many parts that must be learnt to build a modern application. I have just process mapped my app and thought sharing may be interesting to others.

900x600-1-50-21a02e97c9d3a230c4bac53f3511253d

I’m in Koh lanta

Special thanks to Duncan

Whilst I was in the UK having a beer with Duncan he mentioned he enjoyed my posts so after sprucing up this site I thought I should write one – so here it is.


On the way back from my trip to the UK I decided to stay in Thailand for a bit. I had 1 week in Bangkok (which I found rather hard to get around) and spent the last week in Koh Lanta. Koh lanta is a lovely place that is not that busy (not like Phuket) but very beautiful. Although I have seen a lot because I have spent most of my time working in this coworking space called Kohub

Kohub is my favourite coworking space they have a lovely outdoor area, a waterfall, pol table , fast internet and I can order meals online and the kitchen check my photo on my profile, find me and arrive at my desk with my meal.

They have yoga mats too but haven’t yet used them yet.

Snorkeling

For my first touristy activity I went snorkelling on Sunday out in nearby Islands of Koh Haa, Koh Bida and Ko Rok – $50 well spent. below are some of things I saw. I saw a sea snake slithering along the bottom (below) – watched it for a while but decided not to play with it.

FUN FACT: snorkerled/snorkeling is American English; snorkelled/snorkelling is the spelling in British English.



Next Movements

I’ve been very productive since Koh Lantra – found being somewhere inspiring is good for my productivity. I have knocked over a lot of tasks that I did not enjoy this week. One of those jobs is overhauling this website which I like now.

Still figuring things out but what will help me get more time is keeping costs low whilst improving fitness and having fun at the same time. In this aim I have been looking into making my own breakfast. As I am trying to get in a routine that works and enables a low cost, nutritious low carb start to the day.

Cooking in a hotel

One problem I have is a lack of a kitchen. Saw this video which made me chuckle – very ingenious – not sure if I’ll be doing it though!