You can use custom states for this. I have created the same feature in one of my application.
When someone click on any of the chip save them in a custom state, and when click again remove them from custom state.