I have very mixed feelings about it - I don't like how much resources we put into countries like Syria, especially when it's choices like ISIS or Assad, who are both monstrous in their own way. But I really don't like the possibility of major destabilization when we leave, or the false stability of brutal tyranny, and enabling rival nations (mainly Russia and Turkey) to exert more and more influence in the region. And I really, really, REALLY don't like the fact that the second position tends to lead to something like a permanent stalemate occupation.
The declaring victory part is of course absurd and we'll almost certainly see a resurgence of ISIS and other rebel factions when we go. But that's par for the course.