Skip to content
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

Update 03-forms-and-events.md #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update 03-forms-and-events.md #31

wants to merge 1 commit into from

Conversation

robots4life
Copy link
Contributor

Inconsistency between the code in step https://blaze-tutorial.meteor.com/simple-todos/02-collections.html#2-3-Render-Tasks-Collection and https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#3-4-Add-Submit-Listener.

return TasksCollection.find({});

is suddenly changed to

return TasksCollection.find({}, { sort: { createdAt: -1 } });

Sure it makes sense to sort the results, however it might be better to have this sorting code only included later on, that is, in the next step where it is explained. https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#3-5-Show-Newest-Tasks-First

Inconsistency between the code in step https://blaze-tutorial.meteor.com/simple-todos/02-collections.html#2-3-Render-Tasks-Collection and https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#3-4-Add-Submit-Listener.

```javascript
return TasksCollection.find({});
```
is suddenly changed to
```javascript
return TasksCollection.find({}, { sort: { createdAt: -1 } });
```
Sure it makes sense to sort the results, however it might be better to have this sorting code only included later on, that is, in the next step where it is explained. https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#3-5-Show-Newest-Tasks-First
@StorytellerCZ
Copy link
Collaborator

It is described on line 101. Do you think that should be completely separate step?

@robots4life
Copy link
Contributor Author

It is described on line 101. Do you think that should be completely separate step?

That would be less confusing and more helpful. With that also the opportunity could be taken to go into details about the -1 and those being a key value pair for the task, or in the task document that then is sort-able by timestamp. The key value explanation could then be be referenced in the https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#Attaching-events-to-templates section with something like "similar to above mentioned createdAt: -1 to add a timestamp to the task in step https://blaze-tutorial.meteor.com/simple-todos/03-forms-and-events.html#3-4-Add-Submit-Listener (or a new step that specifically talks about this) the event listener also works with a key value pair..

The alternative to that could be to have line 101 moved up to line 70 and give a bit more detail about it. But then you have the discrepancy between the headline being Add Submit Listener but the content starting with adding a timestamp to the task. The -1 could also get some attention, as in, say what -1 exactly does for the timestamp.

I am under the impression a separate step could help beginners better, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants