removeFeedItemAction function

ThunkAction<FeedState> removeFeedItemAction(
  1. String item, {
  2. 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));
  };
}