git ssb

7+

dinoworm 🐛 / patchcore



Commit 44961c2780748726db65c43b176255be3a0de333

timeAgo: use less resources to update timestamps

still could be optimised a lot!
Matt McKegg committed on 6/28/2017, 6:15:53 AM
Parent: e92ded1555551390c87a00d5e77f02935f60f00e

Files changed

lib/timeAgo.jschanged
lib/timeAgo.jsView
@@ -12,14 +12,16 @@
1212 var timer
1313 var value = Value(Time(timestamp))
1414 return computed([value], (a) => a, {
1515 onListen: () => {
16- timer = setInterval(refresh, 5e3)
16 + timer = setInterval(refresh, 30e3)
1717 refresh()
1818 },
1919 onUnlisten: () => {
2020 clearInterval(timer)
2121 }
22 + }, {
23 + idle: true
2224 })
2325
2426 function refresh () {
2527 value.set(Time(timestamp))

Built with git-ssb-web