Extracted watcher and runner into supervision tree.

This commit is contained in:
Nathan Walker
2017-04-26 21:38:22 -05:00
parent 3c73ea00fa
commit 372d7f70ac
6 changed files with 78 additions and 55 deletions

View File

@@ -1,14 +1,13 @@
defmodule Watcher do
use ExFSWatch, dirs: ["lib/koans"]
def start_link do
start()
end
def callback(file, events) do
if Enum.member?(events, :modified) do
file |> normalize |> reload
if Tracker.complete? do
Display.congratulate
exit(:normal)
end
end
end