github-presence/lua/github_presence/timer.lua

17 lines
385 B
Lua
Raw Normal View History

2022-10-13 22:19:21 +02:00
local github = require "github_presence.github"
local updates = require "github_presence.updates"
return {
start_cron = function()
local timer = vim.loop.new_timer()
timer:start(
1000,
1000 * 60,
2022-10-14 21:52:49 +02:00
vim.schedule_wrap(function()
if updates.last_activity == nil then return end
github.set_status(updates.last_activity)
end)
2022-10-13 22:19:21 +02:00
)
end,
}