mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 02:29:10 +00:00
first bits of redux
This commit is contained in:
parent
9c7f7fda73
commit
def2b0d2a3
13 changed files with 170 additions and 16 deletions
16
ui/stores/servers.js
Normal file
16
ui/stores/servers.js
Normal 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 }))
|
Loading…
Add table
Add a link
Reference in a new issue