Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1032125 // waitUntilNotNull - synonym of waitForVarToBeNotNull + IVarWithNotify

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5907L) is out of date.

static <A> A waitUntilNotNull(Var<A> v) {
  ret waitForVarToBeNotNull(v);
}

ifclass IVarWithNotify
static <A> A waitUntilNotNull(IVarWithNotify<A> v) {
  new Var<A> myVar;
  temp tempOnChangeAndNow(v, -> myVar.set(v!));
  ret waitUntilNotNull(myVar);
}
endif

ifclass VarWithNotify
static <A> A waitUntilNotNull(VarWithNotify<A> v) {
  ret waitUntilNotNull((Var<A>) v);
}
endif

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032125
Snippet name: waitUntilNotNull - synonym of waitForVarToBeNotNull + IVarWithNotify
Eternal ID of this version: #1032125/7
Text MD5: df5506c98cd6674a1f622fa14c737a6c
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-08 09:17:54
Source code size: 394 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 197 / 277
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)