Notifications broadcast from GitHub

This commit is contained in:
James Barnsley
2017-05-29 20:04:01 +12:00
parent d9b501cd51
commit 7ed321b95f
3 changed files with 30 additions and 5 deletions

View File

@ -1,6 +1,26 @@
import * as helpers from '../../helpers'
export function getBroadcasts(){
return (dispatch, getState) => {
var config = {
method: 'GET',
url: 'https://gist.githubusercontent.com/jaedb/b677dccf80daf3ccb2ef12e96e495677/raw'
}
$.ajax(config).then(
response => {
dispatch({
type: 'BROADCASTS_LOADED',
broadcasts: JSON.parse(response)
})
},
(xhr, status, error) => {
console.error('Could not fetch broadcasts from GitHub')
}
)
}
}
export function showContextMenu(data){
data.position_x = data.e.clientX
data.position_y = data.e.clientY