How to Combine React Contexts

If you just want to see the example source code, you can find it here The React Context API is used for passing down data to all the child components that need it. You can think of it as a global state, which you do not need to pass down through intermediary components. Sometimes, you will need to use two or more contexts together. But as you can see in the official example and in the example below, it can get a bit messy:...

 · Soham Kamani

Using Context in Golang - Cancellation, Timeouts and Values (With Examples)

In this post, we’ll learn about Go’s context package, and more specifically, how we can use cancellation to improve our applications performance. We will also go through some patterns and best practices when using the context package in your Golang application. When Do We Use Context? As the name suggests, we use the context package whenever we want to pass around “context”, or common scoped data within our application. For example:...

Last Updated:   · Soham Kamani