PreserveOnRefresh for non vaadin components

I am wondering if it is possible for a custom(Non vaadin) components written using lit-element to support PreserveOnRefresh. I have been experimenting with some third-party grids and found that while Vaadin components retain their state, my custom grid does not. Are there any resources or documentation available to provide guidance on how to implement this feature? PS : I had posted this message in another slightly unrelated thread.

You might want to look into the attach event especially