mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-15 01:16:22 +02:00
18 lines
477 B
JavaScript
18 lines
477 B
JavaScript
import { List } from 'immutable';
|
|
import { RECIEVE_KEYS, ADD_KEY, REMOVE_KEY } from './actions';
|
|
|
|
const store = (state = new List(), action) => {
|
|
switch (action.type) {
|
|
case RECIEVE_KEYS:
|
|
return new List(action.tokens);
|
|
case ADD_KEY:
|
|
return state.push(action.token);
|
|
case REMOVE_KEY:
|
|
return state.filter(v => v.secret !== action.secret);
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default store;
|