SHARE
TWEET

Untitled

a guest Dec 9th, 2019 113 in 137 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace SharedGateways {
  2.     public class yyy {
  3.        
  4.         private Subject<int> bar;
  5.         private IObservable<int> Bar => Bar;
  6.  
  7.         public async UniTask Launch(){
  8.            
  9.             // calcs
  10.             await UniTask.Delay(1);
  11.            
  12.             bar.OnNext(42);
  13.         }
  14.  
  15.        
  16.         public async void OldWayToCall(){
  17.             Bar.Subscribe(fortyTwo => {
  18.                 // do something
  19.             });
  20.             await Launch();
  21.         }
  22.  
  23.         // ===
  24.  
  25.         public async UniTask<int> NewLaunch(){
  26.             // !!
  27.             // puzzle is here
  28.             // !!
  29.         }
  30.  
  31.         public async void NewWayToCall(){
  32.             var fortyTwo = await NewLaunch();
  33.             // do something
  34.         }
  35.     }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top