What's the point of a law requiring it? Unless it's an addition to a minimum wage law and only in effect for those being paid the minimum wage...
Also the employer may have the option of not activating the noncompete clause when the employee leaves the company, meaning the employee is free and no compensation is due.