Last active
August 29, 2015 14:21
-
-
Save tokenvolt/9407c617f2bde7ae2de4 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
contextTypes: | |
router: React.PropTypes.func | |
tree: React.PropTypes.func | |
componentDidMount: -> | |
# TODO: set initial currentPath on page load | |
CurrentPathCursor = @props.tree.select('currentPath') | |
CurrentPathCursor.on 'update', (e) => | |
if e.data.previousData != e.data.data | |
@context.router.transitionTo(CurrentPathCursor.get()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment