Libraryless. Click here for Pure Java version (15232L/93K).
1 | static <A> LiveValue<A> dm_calculatedLiveValue(final DynModule module, final Class type, final F0<A> calc) {
|
2 | lock module.lock; |
3 | final SimpleLiveValue value = new(type, callF(calc)); |
4 | module.onChange(r { value.set(callF(calc)) });
|
5 | ret value; |
6 | } |
7 | |
8 | static <A> LiveValue<A> dm_calculatedLiveValue(Class type, F0<A> calc) {
|
9 | ret dm_calculatedLiveValue(dm_current_mandatory(), type, calc); |
10 | } |
11 | |
12 | static <A> LiveValue<A> dm_calculatedLiveValue(Class<A> type, IF0<A> calc) {
|
13 | ret dm_calculatedLiveValue(type, if0ToF0(calc)); |
14 | } |
15 | |
16 | static LiveValue<O> dm_calculatedLiveValue(IF0<?> calc) {
|
17 | ret dm_calculatedLiveValue(O, (F0) if0ToF0(calc)); |
18 | } |
Began life as a copy of #1015971
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1016014 |
| Snippet name: | dm_calculatedLiveValue - live-value for a calculation that is updated when DynModule changes |
| Eternal ID of this version: | #1016014/9 |
| Text MD5: | e7653b8060cf4ac35f3d5bd18e73bfb1 |
| Transpilation MD5: | 1fcf9afbf32a88c450882f7a90d9b90b |
| Author: | stefan |
| Category: | javax / stefan's os |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-08-14 09:07:32 |
| Source code size: | 652 bytes / 18 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 759 / 908 |
| Version history: | 8 change(s) |
| Referenced in: | [show references] |