Skip to content

Instantly share code, notes, and snippets.

View alfondotnet's full-sized avatar
๐Ÿ„โ€โ™‚๏ธ
๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„

Alfonso Embid-Desmet alfondotnet

๐Ÿ„โ€โ™‚๏ธ
๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„ ๐Ÿ„
View GitHub Profile
@alfondotnet
alfondotnet / confirmation-react-decorator-poc.js
Created February 5, 2016 19:17
Request Confirmation decorator for React Component methods.
// Full Proof of Concept here http://jsbin.com/hupejawequ/1/edit?html,css,js,output
@requireConfirmation(["pay"]) // only request confirmation for the 'pay' method
class FormWithButton extends React.Component {
constructor() {
super();
// We have to bind, () => {} doesnt work
this.pay = this.pay.bind(this);
this.request = this.request.bind(this);