We need a global object that is always available for all the elements in an application. Let’s use a singleton, which is a design pattern that helps us create an object only one time.