Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

todo app remaining tasks reducer func fixed and clarified #1050

Closed
wants to merge 2 commits into from

Conversation

sulmanen
Copy link

@sulmanen sulmanen commented Apr 6, 2016

Reduce func in get remaining() looked funny in the example. Maybe this is clearer.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@sulmanen
Copy link
Author

sulmanen commented Apr 6, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added CLA: yes and removed CLA: no labels Apr 6, 2016
@gkalpak
Copy link
Member

gkalpak commented Apr 6, 2016

Indeed count + +!todo.done was a little too much :)
Even simpler would be:

this.todos.filter((todo: Todo) => !todo.done).length

@sulmanen
Copy link
Author

sulmanen commented Apr 6, 2016

why yes, much better.

@wardbell
Copy link
Contributor

wardbell commented Apr 6, 2016

I agree that it reads better. The reduce would be more efficient if we had a gazillion todos ... an absurdity in itself. Accepting ... after taking it the last step (because of type inference):

return this.todos.filter(todo => !todo.done).length;

Snuck in a few similar cleanups and spacing for readability.

Thanks.

@wardbell wardbell closed this in 9370113 Apr 6, 2016
thelgevold pushed a commit to IdeaBlade/angular.io that referenced this pull request Apr 9, 2016
closes angular#972

chore(toh): change inputs array for input decorator/hero now a class

docs(dart): update to b12

Also update dart_to_js_script_rewriter dependency to ^1.0.1,
and change most angular2.dart imports to be core.dart instead.

The pipes example broke without the angular2.dart import, so I let it be.

The server-communication sample has never worked for me,
so I changed it but might have broken it further.

closes angular#1007

docs: update to style-guide links
closes angular#995
Fixed links to John Papa style guide to new repo location.

docs(cb-ts-to-js): add cookbook about applying TypeScript examples to ES5
closes angular#893

docs(dart): change imports from bootstrap.dart to platform/browser.dart

closes angular#1013

samples(dart): add info file for dart-doc-syncer to template-syntax

closes angular#1018

samples(dart): add link to documentation chapter

closes angular#1019

docs(toh-1): remove public access modifiers
closes angular#1009
Remove public access modifier on AppComponent properties to be
consistent throughout code tutorial

docs(dependency-injection): tweak Dart wording

closes angular#1017

docs(dart): tweak homepage banner

closes angular#1016

docs(quickstart): fixed "hurray" typo.
closes angular#1021

docs: update to beta.13

docs(dart/quickstart): merge 2 examples into 1

closes angular#1031

docs(dart): update to beta.13.1

closes angular#1032

Add additional tags to the angular.io dgeni package for the new api doc style proposal.

Closes angular#1030

chore: remove angulardart.org link from footer

closes angular#1034

fix(api-builder): add missing git package dependency

This was causing the api-builder tests to fail

chore(typo): quide -> guide in cheatsheets

closes angular#1039

docs:Create Tour of Heroes chapter on http

some text changes

wired up web api

text

adding saving

wired up CRUD

remove unused files

fixed toggle

whitespace

text

text

text updates

text

text

tweaks

added tests

test

fixed button click

images

fixed test

tweaks

docs(toh): add missing nav path to diagram per angular#1041

chore: fix typo in ts-to-js intro
closes angular#1025

chore(bio): add Deborah's bio
closes angular#1024

docs(bio): fixes Jules' bio links
closes angular#1027

fix(e2e): fix race condition

docs(toh-4): reword the getHeroesSlowly instructions
closes angular#1011
rewording to: "replace `_heroService.getHeroes` with `_heroService.getHeroesSlowly`"

docs: add DI cookbook

chore: replace VSCode-specific settings.json with broadly recommended .editorconfig
closes angular#1022

docs(template-syntax): fixed "a id" typo in basics section.
closes angular#1048

chore: add "homepage" property to package.json
closes angular#1038

docs(testing): update testing to use toh-5
closes angular#1003

docs(unit-testing): fix the path to node_modules & steps for adding a new spec
closes angular#1043

package(harp): update harp version to fix async errors

docs(component-styles): add chapter about styling components
closes angular#1047

docs(lifecycle-hooks): Fixed missing ":marked" typo
closes angular#1051

docs(todo app): replace remaining tasks reduce func with filter.length
closes angular#1050

docs(component-styles): mark `__moduleName` experimental; use alert instead of callout.
closes angular#1054

docs(pipes): Fixed "If follows..." typo
closes angular#1053
Fixed typo in **pipes** section of guide.

chore: update to beta.14
AlmeroSteyn pushed a commit to IdeaBlade/angular.io that referenced this pull request Apr 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants