This file contains hidden or 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
local configs = require 'lspconfig.configs' | |
local lspconfig = require 'lspconfig' | |
-- Check if the config is already defined (useful when reloading this file) | |
if not configs.ensime then | |
configs.ensime = { | |
default_config = { | |
cmd = { | |
'java', '-jar', os.getenv("HOME") .. '/.cache/ensime/lib/ensime-lsp.jar' | |
}, |
This file contains hidden or 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
const reduce = (obj, fun, initialValue) => | |
Object.entries(obj).reduce( | |
(prev, [key, value]) => fun(prev, key, value), | |
initialValue | |
); |
This file contains hidden or 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
const filter = (obj, fun) => | |
Object.entries(obj).reduce( | |
(prev, [key, value]) => ({ | |
...prev, | |
...(fun(key, value) ? { [key]: value } : {}) | |
}), | |
{} | |
); |
This file contains hidden or 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
const map = (obj, fun) => | |
Object.entries(obj).reduce( | |
(prev, [key, value]) => ({ | |
...prev, | |
[key]: fun(key, value) | |
}), | |
{} | |
); |
This file contains hidden or 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
class SelectableItem extends React.Component { | |
constructor() { | |
super(); | |
this.handleOnPress = this.handleOnPress.bind(this); | |
} | |
shouldComponentUpdate(nextProps) { | |
const { isSelected } = this.props; | |
return isSelected !== nextProps.isSelected; |