After implementing a producer purchase we need to make sure they do the work!
Each second the producer should give us the amount of gold equal to their baseProduction.
- Add a new field 
productionRateto the config object exported fromconstants.js. - Initial value of 
productionRateshould equal to 0. - When the user purchases a new producer, we should increase the global 
productionRate - Implement and export a handler 
handleStateChange(term, state)inhandlers.jsthat should call a functionupdateGold(term, state) - In the 
updateGoldfunction, increment the value of gold by productionRate each time it’s called - In 
startMiningGameset the interval that will callhandleStateChangeonce every second handleStateChangeshould be a closure and return a function in order to be used insetInterval- Remove the call to 
updateGoldfrom thehandleKeyPressto avoid accounting issues 
This task is part of the Full-Stack JavaScript Course.
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.