The init function is called when the parse-address module is required, which happens eagerly on a regular webpack setup.
The init function is very expensive and can take up to 100ms just to run, on one of these expensive MacBooks, on mobile phones it can take 2-3x that.
This PR allows us to call the init function only when the one of the parse functions are actually called, saving precious ms on the application startup that are using it.
As a bonus I removed State_FIPS which isn't used anywhere in the code.
The
init
function is called when theparse-address
module is required, which happens eagerly on a regular webpack setup. Theinit
function is very expensive and can take up to 100ms just to run, on one of these expensive MacBooks, on mobile phones it can take 2-3x that. This PR allows us to call theinit
function only when the one of the parse functions are actually called, saving precious ms on the application startup that are using it.As a bonus I removed
State_FIPS
which isn't used anywhere in the code.