1 | static java.util.Timer onValueChangeAndNow(int interval, final F0 f, fO onChange) { |
2 | ret doEveryAndNow(interval, new Runnable { |
3 | bool firstTime = true; |
4 | O lastValue; |
5 | |
6 | public void run { |
7 | O value = callF(f); |
8 | if (firstTime || neq(value, lastValue)) { |
9 | firstTime = false; |
10 | lastValue = value; |
11 | callF(onChange, value); |
12 | } |
13 | } |
14 | }); |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017370 |
Snippet name: | onValueChangeAndNow - monitor a value regularly |
Eternal ID of this version: | #1017370/3 |
Text MD5: | d698a263cb056003df69aecf6dea578c |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-18 15:48:59 |
Source code size: | 395 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 366 / 392 |
Version history: | 2 change(s) |
Referenced in: | [show references] |