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

24
LINES

< > BotCompany Repo | #1034515 // varWithNotifyToLiveValue_verbose

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

Transpiled version (6452L) is out of date.

static <A> SimpleLiveValue<A> varWithNotifyToLiveValue_verbose(Class<A> type, IVarWithNotify<A> var) {
  if (var == null) null;
  var lv = new SimpleLiveValue<A>(type);
  var lvRef = weakRef(lv);
  var.onChange(r {
    var lv = lvRef!;
    if (lv == null)
      var.removeChangeListener(this);
    else {
      var value = var!;
      print("varChange " + value);
      lv.set(value);
    }
  });
  lv.onChange(-> {
    var value = lv!;
    print("lvChange " + value);
    var.set(value);
  });
  var value = var!;
  print("varToLvInit " + value);
  lv.set(value);
  ret lv;
}

Author comment

Began life as a copy of #1034093

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034515
Snippet name: varWithNotifyToLiveValue_verbose
Eternal ID of this version: #1034515/2
Text MD5: 14e1a1fabc9e3429ecc6c400e6b42da4
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-10 05:33:40
Source code size: 599 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 201 / 234
Version history: 1 change(s)
Referenced in: [show references]