The cost of any individual elements or bundles you unlock within a particular source will be credited toward the purchase of the full source.
Let's say you purchase 3 spells from the Player's Handbook for $2 each (rounding for easier math) for a total of $6, then the PHB Races bundle for $6. If you later decide to purchase the entire Player's Handbook, you will receive a credit on that purchase of $12, making the total remaining cost ~$18.
This also applies to the Legendary Bundle. If you buy the three Core Rulebooks while they are on sale the first week, you will be credited ~$60 toward your purchase of the Legendary Bundle. You should probably just take the plunge after that, right?
This is NOT A REFUND - you will see the "remaining cost" price for the product up front and make your purchase decision from there.