public void UpdateCatalog(Action <List <ServerlessCatalogItem> > onSuccess = null, Action <Error> onError = null) { List <ServerlessCatalogItem> catalog = GetCatalog(); _items = catalog.Where(i => i.IsVirtualItem()).ToList(); _currencies = catalog.Where(i => i.IsCurrency()).ToList(); UpdateItemsEvent?.Invoke(_items); UpdateVirtualCurrenciesEvent?.Invoke(_currencies); onSuccess?.Invoke(catalog); }
private IEnumerator UpdateVirtualCurrenciesCoroutine(Action <Error> onError = null) { var busy = true; SdkCatalogLogic.Instance.GetVirtualCurrencies(items => { VirtualCurrencies = items; UpdateVirtualCurrenciesEvent?.Invoke(items); busy = false; }, onError); yield return(new WaitWhile(() => busy)); }
private IEnumerator UpdateVirtualCurrenciesCoroutine(Action <Error> onError = null) { var busy = true; _demoImplementation.GetCatalogVirtualCurrencies(items => { Currencies = items; AllItems.AddRange(items); UpdateVirtualCurrenciesEvent?.Invoke(items); busy = false; }, onError); yield return(new WaitWhile(() => busy)); }