Progress on Gab Deck, Updates on Compose
• Progress on Gab Deck, Updates on Compose
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { me } from '../initial_state'
|
||||
import { saveSettings } from './settings'
|
||||
|
||||
export const DECK_CONNECT = 'DECK_CONNECT'
|
||||
export const DECK_DISCONNECT = 'DECK_DISCONNECT'
|
||||
|
||||
export const DECK_SET_COLUMN_AT_INDEX = 'DECK_SET_COLUMN_AT_INDEX'
|
||||
export const DECK_DELETE_COLUMN_AT_INDEX = 'DECK_DELETE_COLUMN_AT_INDEX'
|
||||
export const DECK_CHANGE_COLUMN_AT_INDEX = 'DECK_CHANGE_COLUMN_AT_INDEX'
|
||||
|
||||
export const deckConnect = () => ({
|
||||
type: DECK_CONNECT,
|
||||
@@ -13,8 +16,28 @@ export const deckDisconnect = () => ({
|
||||
type: DECK_DISCONNECT,
|
||||
})
|
||||
|
||||
export const setDeckColumnAtIndex = (column, index) => ({
|
||||
type: DECK_SET_COLUMN_AT_INDEX,
|
||||
column,
|
||||
index,
|
||||
})
|
||||
export const setDeckColumnAtIndex = (column, index) => (dispatch) => {
|
||||
dispatch({
|
||||
type: DECK_SET_COLUMN_AT_INDEX,
|
||||
column,
|
||||
index,
|
||||
})
|
||||
dispatch(saveSettings())
|
||||
}
|
||||
|
||||
export const deleteDeckColumnAtIndex = (index) => (dispatch) => {
|
||||
dispatch({
|
||||
type: DECK_DELETE_COLUMN_AT_INDEX,
|
||||
index,
|
||||
})
|
||||
dispatch(saveSettings())
|
||||
}
|
||||
|
||||
export const updateDeckColumnAtIndex = (oldIndex, newIndex) => (dispatch) => {
|
||||
dispatch({
|
||||
type: DECK_CHANGE_COLUMN_AT_INDEX,
|
||||
oldIndex,
|
||||
newIndex,
|
||||
})
|
||||
dispatch(saveSettings())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user