Skip to content

Instantly share code, notes, and snippets.

@petrbrzek
Created August 13, 2015 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrbrzek/995ab7077089ff63e9b6 to your computer and use it in GitHub Desktop.
Save petrbrzek/995ab7077089ff63e9b6 to your computer and use it in GitHub Desktop.
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