You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In part 1 of the todo list application the State record is defined as:
typeState={
TodoList :string list
NewTodo :string}
then in part 2 the properties are suddenly flipped around:
typeState={
NewTodo:string
TodoList :Todo list}
This is somewhat confusing and it breaks the init() function.
I'd be happy to submit a pull request with a fix, but not sure which part(s) you'd prefer to be rewritten/reordered. I guess rewriting part 1 would be easiest.
The text was updated successfully, but these errors were encountered:
Hi @bzuu, thanks for pointing this out! I too believe this should be consistent 💯 I will keep it mind the next time when I make the updates to the book soon
@bzuu The order of the fields doesn't matter, but it can be made consistent. It is the change from TodoList : string list to TodoList : Todo list that breaks the init() function, but this is part of the required steps in refactoring between the Todo part 1 version, and Todo part 2 version to add the Completed boolean flag. It's supposed to break the init() function because you are purposefully changing the Type to add a new feature. The updated version of init() could be explicitly added to part 2, or alternatively, this blurb from the Todo exercises page could be brought forward and reworded:
Currently each to-do's ID is an int, however .Net framework has a built-in module specifically for generating unique IDs: System.Guid.
The point of this exercise is to change the Todo type so the ID is of type Guid, then, using the IDE's errors, or even compiler errors, find all the places the change breaks the type-system and refactor them to make the application compile again.
In part 1 of the todo list application the State record is defined as:
then in part 2 the properties are suddenly flipped around:
This is somewhat confusing and it breaks the
init()
function.I'd be happy to submit a pull request with a fix, but not sure which part(s) you'd prefer to be rewritten/reordered. I guess rewriting part 1 would be easiest.
The text was updated successfully, but these errors were encountered: