2016-10-27 16:58:11 +13:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Actions and Action Creators
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
export function setConfig( config ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_SET_CONFIG',
|
|
|
|
|
config: config
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 09:14:29 +13:00
|
|
|
export function setUsername( username ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_INSTRUCT',
|
|
|
|
|
action: 'set_username',
|
|
|
|
|
data: { username: username }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-27 16:58:11 +13:00
|
|
|
export function connect(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_CONNECT'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function disconnect(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_DISCONNECT'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-28 09:14:29 +13:00
|
|
|
export function getConnectionList(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_INSTRUCT',
|
|
|
|
|
action: 'get_connections'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function instruct( action, data = null ){
|
2016-10-27 16:58:11 +13:00
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_INSTRUCT',
|
2016-10-28 09:14:29 +13:00
|
|
|
action: action,
|
|
|
|
|
data: data
|
2016-10-27 16:58:11 +13:00
|
|
|
}
|
|
|
|
|
}
|