mobyvb / tasklist

a tool to keep track of tasks and how long you've been working on them
0 stars 0 forks source link

Get rid of globals #24

Closed black-crowned-night-heron closed 1 year ago

black-crowned-night-heron commented 1 year ago

The code has been refactored to encapsulate the operations on the tasks within a struct called 'TaskList'. This helps to remove the global variable tasks and brings in more modularity and clarity to the code. The functions which were earlier standalone functions have now been made methods on the TaskList struct. Also the 'handleCommand' function now accepts the TaskList object as a parameter so it can operate on its tasks.

Resolves #23