-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accumulate timers
#103
Comments
making a stab at this now. have a decent idea of how to achieve it. 🧑💻 🤞 ⏳ |
The fun part is writing tests ... 💭 |
1) test accumulate timers #103 accummulate_item_timers/1 to display cummulative timer (App.TimerTest)
test/app/timer_test.exs:41
** (Enum.EmptyError) empty error
code: acc = Item.accumulate_item_timers(items_with_timers)
stacktrace:
(elixir 1.13.4) lib/enum.ex:2342: Enum.reduce/2
(app 0.1.0) lib/app/item.ex:209: anonymous fn/3 in App.Item.accumulate_item_timers/1
(elixir 1.13.4) lib/enum.ex:1593: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.13.4) lib/map.ex:236: Map.new_from_enum/2
test/app/timer_test.exs:97: (test) 🙄 |
Lucky guess: used |
I've got this working ... but it's not pretty ... 😕 |
But there's a test and lots of comments so it should be "refactorable" by someone smarter than me. 🤞 |
GIF showing a timer being started, stopped and started again: Obvs the disappearing timer isn't great UX. GOTO: #106 |
Confident this is working now: Had to port the So server-sided rendering the stopped timer. |
At present when we
stop
atimer
it disappears from the UI. 🤦♂️Then when we
start
anew
one it does not reflect the previous timers (if there are any) ...This is obviously not the desired behaviour.
What we want is to:
timer.end - timer.start
) for all previous timerstimer.start
so that timerscontinue
counting.The text was updated successfully, but these errors were encountered: