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

10
LINES

< > BotCompany Repo | #1033781 // dm_transientCalculatedLiveValue - live-value for a calculation that is updated when a transient field changes

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

Libraryless. Click here for Pure Java version (15221L/93K).

static <A> LiveValue<A> dm_transientCalculatedLiveValue(DynModule mod default dm_current_mandatory(), Class type, IF0<A> calc) {
  lock mod.lock;
  SimpleLiveValue value = new(type, calc!);
  mod.onFieldChange(voidfunc(S field) { value.set(calc!) });
  ret value;
}

static LiveValue<O> dm_transientCalculatedLiveValue(IF0<O> calc) {
  ret dm_transientCalculatedLiveValue(O, calc);
}

Author comment

Began life as a copy of #1016014

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033781
Snippet name: dm_transientCalculatedLiveValue - live-value for a calculation that is updated when a transient field changes
Eternal ID of this version: #1033781/6
Text MD5: 1133c911ffc0ba36d1ff705191feab62
Transpilation MD5: 0b0a5bf13407f9512a14931ad4bde4d1
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-03 01:59:21
Source code size: 392 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 138 / 219
Version history: 5 change(s)
Referenced in: [show references]