Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
React keymaps idea
module.exports =
ProjectManager:
PROJECT_MANAGER_MOVE_LEFT:
osx:
'left'
windows:
'left'
linux:
'left'
PROJECT_MANAGER_MOVE_RIGHT:
osx:
'right'
windows:
'right'
linux:
'right'
# In different file
module.exports = React.createClass
displayName: 'ProjectManager'
mixins: [KeymapsMixin(KeymapsStore)]
keymaps: (keymap) ->
switch keymap
when Keymap.PROJECT_MANAGER_MOVE_LEFT then _.partial(@_move, 'left')
when Keymap.PROJECT_MANAGER_MOVE_RIGHT then _.partial(@_move, 'right')
render: ->
div
className: loadingClassNames,
Progress
type: 'indefinite'
title: 'Loading project. Please wait.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment