hugobarauna commited on
Commit
6a67920
1 Parent(s): b4554b8

Update public-apps/rune_finder.livemd

Browse files
Files changed (1) hide show
  1. public-apps/rune_finder.livemd +5 -4
public-apps/rune_finder.livemd CHANGED
@@ -100,20 +100,21 @@ form =
100
  output_frame = frame()
101
 
102
  Kino.listen(form, fn event ->
103
- Kino.Frame.clear(output_frame)
 
104
 
105
  case event.data.name do
106
  "" ->
107
- Kino.Frame.render(output_frame, "Please provide words to find.")
108
 
109
  _ ->
110
  runes = RuneFinder.main(event.data.name)
111
 
112
  Enum.each(runes, fn rune ->
113
- Kino.Frame.append(output_frame, text(rune))
114
  end)
115
 
116
- Kino.Frame.append(output_frame, text("\n#{Enum.count(runes)} found"))
117
  end
118
  end)
119
 
 
100
  output_frame = frame()
101
 
102
  Kino.listen(form, fn event ->
103
+ origin = event.origin
104
+ Kino.Frame.clear(output_frame, to: origin)
105
 
106
  case event.data.name do
107
  "" ->
108
+ Kino.Frame.render(output_frame, "Please provide words to find.", to: origin)
109
 
110
  _ ->
111
  runes = RuneFinder.main(event.data.name)
112
 
113
  Enum.each(runes, fn rune ->
114
+ Kino.Frame.append(output_frame, text(rune), to: origin)
115
  end)
116
 
117
+ Kino.Frame.append(output_frame, text("\n#{Enum.count(runes)} found"), to: origin)
118
  end
119
  end)
120