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

12
LINES

< > BotCompany Repo | #1020939 // mapLiveValue_f0 - apply function to LiveValue where function doesn't need the value

JavaX fragment (include)

1  
static <A, B> LiveValue<B> mapLiveValue_f0(final F0<B> f, final Class<B> type, final LiveValue<A> lv) {
2  
  ret new LiveValue<B>() {
3  
    public Class<B> getType() { ret type; }
4  
    public B get() { ret callF(f); }
5  
    public void onChange(Runnable l) { lv.onChange(l); }
6  
    public void removeChangeListener(Runnable l) { lv.removeChangeListener(l); }
7  
  };
8  
}
9  
10  
static <A, B> LiveValue<B> mapLiveValue_f0(LiveValue<A> lv, Class<B> type, F0<B> f) {
11  
  ret mapLiveValue_f0(f, type, lv);
12  
}

Author comment

Began life as a copy of #1015555

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020939
Snippet name: mapLiveValue_f0 - apply function to LiveValue where function doesn't need the value
Eternal ID of this version: #1020939/4
Text MD5: 73dd41db88698421fbb57989cf05e2dc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-24 17:05:19
Source code size: 492 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 276 / 302
Version history: 3 change(s)
Referenced in: [show references]