I wouldn't worry too much about that. Sure, the new games might be fewer and further between from now on for that platform. But hey, at least you could still easily find most of the popular retail 3DS games out now, some of which being sold for significantly less than their initial MSRP price.
It's worth knowing that an average life cycle of a console typically last anywhere between 5 and 7 years (sometimes longer, depending on the console's success) before it'll be discontinued.
Once that happens, pretty much no new retail games will be released and the products related to the discontinued console won't be produced anymore. From that point on, products for the console will become increasingly harder to locate and will be relegated to second-hand market for generally cheaper than the full-price.
That being said, you could still purchase games from eShop, benefit from online play and get the hardware repaired by Nintendo Customer Service or possibly even a third party service. Though, these services won't stay indefinitely.
There's never a wrong time to purchase any video game console, regardless on how ancient they might be. Though, you might need to research if you'd like to acquire any console and its products past their life cycle.