Skip to content

Commit

Permalink
o evento parece certa ... o button manda o valor coreto, e o db esta …
Browse files Browse the repository at this point in the history
…sendo atualizada ... mas nao ta atualizando a tela
  • Loading branch information
interstar committed Jul 5, 2018
1 parent 883a514 commit 22e9a50
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
11 changes: 4 additions & 7 deletions src/cljs/contascalangos/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

(re-frame/reg-event-db
:adicionar
(fn [coeffects event]
(let [db (:db coeffects)
novo-valor (second event)
itens (:orcamento db)]
{:db (assoc db :orcamento (cons novo-valor itens))}
)
))
(fn [db event]
(let [novo-valor (second event)
itens (:orcamento db)]
{:db (assoc db :orcamento (cons novo-valor itens))} )))
2 changes: 1 addition & 1 deletion src/cljs/contascalangos/subs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(re-frame/reg-sub
::orc
(fn [db] (:orcamento db))
(fn [db _] (:orcamento db))
)

(re-frame/reg-sub
Expand Down
22 changes: 11 additions & 11 deletions src/cljs/contascalangos/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
[:h2 (str @name)]

[:div
[:table
[:tr [:td "Receita"] [:td "Gasta"]]

(for [item @orcamento]
(if (< 0 item)
[:tr
[:td item] [:td] ]
[:tr
[:td]
[:td
[:span {:class "negative"} item]]]))
[:table [:tbody
[:tr [:td "Receita"] [:td "Gasta"]]

(for [item @orcamento]
(if (< 0 item)
[:tr
[:td item] [:td] ]
[:tr
[:td]
[:td
[:span {:class "negative"} item]]]))]
]
]

Expand Down

0 comments on commit 22e9a50

Please sign in to comment.