Libraryless. Click here for Pure Java version (15221L/93K).
1 | static <A> LiveValue<A> dm_transientCalculatedLiveValue(DynModule mod default dm_current_mandatory(), Class type, IF0<A> calc) {
|
2 | lock mod.lock; |
3 | SimpleLiveValue value = new(type, calc!); |
4 | mod.onFieldChange(voidfunc(S field) { value.set(calc!) });
|
5 | ret value; |
6 | } |
7 | |
8 | static LiveValue<O> dm_transientCalculatedLiveValue(IF0<O> calc) {
|
9 | ret dm_transientCalculatedLiveValue(O, calc); |
10 | } |
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: | 419 / 541 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |