You have a legal and 'at will' contract with the company...
Knowing this going in means you should expect to be terminated, plan accordingly, and don't blame the company, its just business, there is nothing personal, we are in this game to make money and each of us is an expense.
This is how capitalism works, one thing gets destroyed to free up resources to go do something better and more productive.