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

Spelling misteaks in code in README #32

Open
robogeek opened this issue Jun 20, 2024 · 1 comment
Open

Spelling misteaks in code in README #32

robogeek opened this issue Jun 20, 2024 · 1 comment

Comments

@robogeek
Copy link

robogeek commented Jun 20, 2024

To take a look at your package I copy/pasted some code and ...

import { IndexedCollectionBase, CollectionIndex, CollectionViewBase } from 'indexed-colection';

This told me there was no such package. Spelling mistake.

class PeopleCollection extends IndexedCollectionBase {
  construtor() {
    super();
  ..
  }
  ..
}

This told me super had to be called from inside a constructor. Spelling mistake.

There may be other mistakes in the README, I haven't checked.

@robogeek
Copy link
Author

Reading on, I see getBobby when the context clearly means getHobby

Also, there's some code that looks like top-level code but appears to be meant to be in the constructor:

e.g.

// Revise within PeopleCollection's constructor
const getHobby = (person) => person.hobbies;
getHobby.isMultiple = true;  // isMultiple = true indicates the value extracted is an array or a set of values

this.hobbyIndex = new CollectionIndex([getBobby]);
this.genderAndHobbyIndex = new CollectionIndex( [person => person.gender, getHobby] );

this.buildIndexes([
  this.genderIndex,
  this.hobbyIndex,
  this.genderAndHobbyIndex,
]);

Using this in top-level code does not make sense.

If this is meant to be in a constructor, then it should be presented that way.

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

No branches or pull requests

1 participant