mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 01:53:51 +00:00
Setup tests environment
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { combineReducers } from 'redux';
|
||||
|
||||
const rootReducer = combineReducers({});
|
||||
import serversReducer from './servers';
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
servers: serversReducer
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
||||
15
src/reducers/servers.js
Normal file
15
src/reducers/servers.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const FETCH_SERVERS = 'shlink/FETCH_SERVERS';
|
||||
const CREATE_SERVER = 'shlink/FETCH_SERVERS';
|
||||
|
||||
export default function serversReducer(state = [{ name: 'bar' }], action) {
|
||||
switch (action.type) {
|
||||
case FETCH_SERVERS:
|
||||
return action.servers;
|
||||
case CREATE_SERVER:
|
||||
return [ ...state, action.server ];
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user