mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02: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:
parent
16dcf858d7
commit
cbffa278f2
@ -16,7 +16,7 @@ const featureTags = (state = getInitState(), action) => {
|
|||||||
case TAG_FEATURE_TOGGLE:
|
case TAG_FEATURE_TOGGLE:
|
||||||
return state.push(new $MAP(action.tag));
|
return state.push(new $MAP(action.tag));
|
||||||
case UNTAG_FEATURE_TOGGLE:
|
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:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user