mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
30 lines
495 B
JavaScript
30 lines
495 B
JavaScript
const RESPONSE_UPDATE = 'responses/update';
|
|
|
|
const initialState = {};
|
|
|
|
// ~~~~~~~~ //
|
|
// REDUCERS //
|
|
// ~~~~~~~~ //
|
|
|
|
export default function (state = initialState, action) {
|
|
switch (action.type) {
|
|
|
|
case RESPONSE_UPDATE:
|
|
return Object.assign({}, state, {
|
|
[action.response.parentId]: action.response
|
|
});
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
|
|
// ~~~~~~~ //
|
|
// ACTIONS //
|
|
// ~~~~~~~ //
|
|
|
|
export function update (response) {
|
|
return {type: RESPONSE_UPDATE, response};
|
|
}
|