In this post I will discuss why and how to use higher-order components (HOC) with React JS.
Why use HOC: Promote reuse of logic across React components.
Components are the typical element for reuse in React but sometimes features don’t fit into this standard. There might be similar methods used to fetch data but maybe the display is different. An example of this is shown later.
As with any new tech it can be overwhelming and confusing how all the parts work together. Especially with the combo of Relay and GraphQL. Hopefully this post will help demystify some things in Relay.
Why use it: One typical issue found in an SPA are the number of network calls made to render a page. Quickly this starts to affect your server performance because the requests made can be high. Relay is focused around efficient network calls helping to mitigate this issue. Another good feature is the queries are close to the components making it obvious the data requirements.
The Singleton pattern is to ensure there is only one instance of the class that exists. In the case it does exist it returns a reference to that object. This is normally achieved by a method belonging to the class to create an instance.
Below is a succinct overview of what is continuous integration, delivery and deployment. The core benefit of following these practices allows developers to ship production code quicker to the user. This should help provide a quicker feedback loop.
Redux has reducers tasked with transforming the state across the application.
They are pure functions, which is a function that does not modify variables outside of its scope
or depend on them. They are given the same parameters and the output should be the same every time.
I’ve moved away from using a Git GUI to command line, I typically used GitExtensions. The reason being, it’s a little annoying having to open any GUI to make a commit and push. It is quicker to use the command line and you learn more about how Git works.