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

Default selectId function for EntityAdapter #378

Closed
code2nguyen opened this issue Sep 11, 2017 · 1 comment
Closed

Default selectId function for EntityAdapter #378

code2nguyen opened this issue Sep 11, 2017 · 1 comment

Comments

@code2nguyen
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x ] Feature request
[ ] Documentation issue or request

What is the current behavior?

I have several entities, and I use always id property for the primary key. So, to create the EntityAdater I must repeat the code like:

export const myEntityAdapter: EntityAdapter<MyEntity> = createEntityAdapter<MyEntity>({
  selectId: (myEntity: MyEntity) => myEntity.id
});

Expected behavior:

This could be greate if createEntityAdapter uses a default selectId method which will take id property of object as a primary key. So I just need call this function

export const myEntityAdapter: EntityAdapter<MyEntity> = createEntityAdapter<MyEntity>();

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

Other information:

@brandonroberts
Copy link
Member

Fixed via #405

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

No branches or pull requests

3 participants