selectAsset function

ThunkAction<GiphyState> selectAsset(
  1. String asset
)

Implementation

ThunkAction<GiphyState> selectAsset(String asset){
  return (Store<GiphyState> store) {
    if (asset == '' || store.state.selectedAsset == asset) {
      return;
    }
    if(store.state.selectedAsset != ''){
      store.dispatch(unSelectGif());
    }
    store.dispatch(SetSelectedAsset(asset));
  };
}