Last active
January 7, 2018 17:35
-
-
Save denisraslov/68565c3ecf3b51f39f3af0d121312922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getStore } from 'react/store'; | |
const Task = Backbone.View.extend({ | |
events: { | |
'click .saveName': function(e) { | |
const name = this.nameInput.value; | |
// Change the name of the task in the model | |
this.model.set('name', name); | |
// Then change it in the store | |
getStore().getState().dispatch({ | |
action: 'CHANGE_TASK', | |
data: { | |
name | |
} | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment