1 | // returns (live value, updater) |
2 | static Pair<SimpleLiveValue<S>, Runnable> trimmedFileLiveValue(final File f, fS defaultValue) { |
3 | final SimpleLiveValue<S> lv = stringLiveValue(trim(loadTextFile(f, defaultValue))); |
4 | lv.onChange(r { saveTextFileIfDifferent(f, lv!) }); |
5 | ret pair(lv, (Runnable) r { lv.set(trim(loadTextFile(f, defaultValue))) }); |
6 | } |
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: | #1016944 |
Snippet name: | trimmedFileLiveValue |
Eternal ID of this version: | #1016944/8 |
Text MD5: | 5d53af4fb0d75a4595ca8eb3a5142fc0 |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-09 13:33:12 |
Source code size: | 353 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 386 / 429 |
Version history: | 7 change(s) |
Referenced in: | [show references] |