1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: use findIndex when using predicate.

indexOf takes and actual value:
https://immutable-js.github.io/immutable-js/docs/#/List/indexOf

findIndex allows you to specify a predicate:
https://immutable-js.github.io/immutable-js/docs/#/List/findIndex
This commit is contained in:
Ivar Conradi Østhus 2021-02-09 12:45:33 +01:00
parent 16dcf858d7
commit cbffa278f2

View File

@ -16,7 +16,7 @@ const featureTags = (state = getInitState(), action) => {
case TAG_FEATURE_TOGGLE:
return state.push(new $MAP(action.tag));
case UNTAG_FEATURE_TOGGLE:
return state.remove(state.indexOf(t => t.value === action.tag.value && t.type === action.tag.type));
return state.remove(state.findIndex(t => t.value === action.tag.value && t.type === action.tag.type));
default:
return state;
}