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

5
LINES

< > BotCompany Repo | #1034554 // linkVars

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

Libraryless. Click here for Pure Java version (5809L/32K).

1  
static <A> void linkVars(IVarWithNotify<A> var1, IVarWithNotify<A> var2) {
2  
  if (var1 == null || var2 == null) ret;
3  
  var2.onChange(value -> var1.set(value));
4  
  var1.onChangeAndNow(value -> var2.set(value));
5  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034554
Snippet name: linkVars
Eternal ID of this version: #1034554/1
Text MD5: 1e5079f1ea40a158866c6f2955e4235d
Transpilation MD5: 44dae335c12df1a6bba41c55bfc01739
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-12 22:42:42
Source code size: 213 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 154 / 219
Referenced in: [show references]