removeFeedItemAction function
ThunkAction<FeedState>
removeFeedItemAction(
- String item, {
- RetrievalFunction? retrievalFunction,
Removes an item from the feed
Implementation
ThunkAction<FeedState> removeFeedItemAction(String item, {RetrievalFunction? retrievalFunction}){
return (Store<FeedState> store) async {
List items = [...store.state.items];
items.removeWhere((element) => (retrievalFunction != null ? retrievalFunction(element) : element) == item);
store.dispatch(_SetFeedItemsEvent(items));
};
}