Notifications broadcast from GitHub
This commit is contained in:
@ -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
|
||||
|
||||
@ -4,6 +4,9 @@ import * as helpers from '../../helpers'
|
||||
export default function reducer(ui = {}, action){
|
||||
switch (action.type) {
|
||||
|
||||
case 'BROADCASTS_LOADED':
|
||||
return Object.assign({}, ui, {broadcasts: action.broadcasts});
|
||||
|
||||
case 'LAZY_LOADING':
|
||||
return Object.assign({}, ui, { lazy_loading: action.start });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user