first bits of redux

This commit is contained in:
41666 2019-03-20 09:25:28 -05:00
parent 9c7f7fda73
commit def2b0d2a3
13 changed files with 170 additions and 16 deletions

16
ui/stores/servers.js Normal file
View file

@ -0,0 +1,16 @@
// @flow
import { namespaceConfig } from 'fast-redux'
// import { Map } from 'immutable'
const DEFAULT_STATE = {}
export type ServersState = typeof DEFAULT_STATE
export const { action, getState: getServerState } = namespaceConfig('servers', DEFAULT_STATE)
export const updateServers = action('updateServers', (state: ServersState, serverData) => ({
...state,
servers: serverData
}))
export const updateSingleServer = action('updateSingleServer', (state, data, server) => ({ ...state, [server]: data }))