Skip to content

Instantly share code, notes, and snippets.

@ibare
Created August 2, 2017 05:01
Show Gist options
  • Save ibare/f49faded7e36ecde54af1d52426c65e4 to your computer and use it in GitHub Desktop.
Save ibare/f49faded7e36ecde54af1d52426c65e4 to your computer and use it in GitHub Desktop.
bind function
const myview = Woowahan.View.create('bindExample', {
initialize() {
this.onDragend = this.onDragend.bind(this);
this.super();
},
viewDidMount() {
this.map.addListener(markerId, 'dragend', this.onDragend);
},
onAddressConversion() {
// something
},
onDragend(event) {
const latitude = event.latLng.lat();
const longitude = event.latLng.lng();
this.dispatch(Woowahan.Action.create(GET_ADDRESS_CONVERSION, {
latitude, longitude
}), this.onAddressConversion);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment