The EventEmitter API allows applications to use an Observer Pattern to register callbacks for when various events occur. We can use this to subscribe new blocks.
provider.on add a listener to be triggered for each event. We can subscribe "block" event that is emitted when a new block is mined.