vpusher / the-grid

Grid layout custom element with drag and drop capabilities
https://www.webcomponents.org/element/vpusher/the-grid
MIT License
129 stars 32 forks source link

Listening for change events #15

Closed lamplightdev closed 7 years ago

lamplightdev commented 7 years ago

Hi,

I want to do something (e.g. persist the current grid layout) after a tile has been moved/resized. Is there a way to do this currently, or would the element need to be updated to fire an event on tile changes, which a containing element could then listen for?

Thanks, Chris.

vpusher commented 7 years ago

Thanks for feedback @lamplightdev. Definitely doable and useful. I will add it in the next release.

yorrd commented 7 years ago

@lamplightdev @vpusher you can add an observer on the databinding on the property and do whatever you want to do there

lamplightdev commented 7 years ago

@yorrd @vpusher thanks for the tip. I'm using polymer-redux however using only one-way data binding so an observer wouldn't work in this case without adding some extra properties to track the tile properties and observing them to then update my redux state which I'd rather avoid

vpusher commented 7 years ago

@lamplightdev are the following events enough for you:

lamplightdev commented 7 years ago

@vpusher yes, those would be ideal, thanks!

vpusher commented 7 years ago

Delivered in v1.2.0. Enjoy.