Thanks for building this library, its been very useful so far.
Would it be possible to add support for entities that identifiers of type number?
E.g.
export class SomeEntity {
SomeEntityId: number;
otherEntities: AnotherEntity[]'
}
export class AnotherEntity {
AnotherEntityId: number;
}
export someEntitySchema = new schema.Entity(
'SomeEntity',
{
otherEntities: [anotherEntitySchema]
},
{
idAttribute: 'SomeEntityId'
});
export anotherEntitySchema = new schema.Entity('AnotherEntity', {}, idAttribute: 'AnotherEntityId'});
Mostly this already works fine, except that I can't use the provided entityProjecter which throws a typescript error:
Argument of type '(entities: {}, id: string) => SomeEntity' is not assignable to parameter of type '(s1: {}, s2: number)
Normalizr itself seems to support ids being numbers and strings, so I modified the interfaces in ngrx-normalizr/normalize.d.ts to allow for numbers and this works (for me at least):
I can create a pull request for you if you prefer, but I had trouble getting the karma tests to run... so thought I'd just ask in case this would be a simple change for you.
Hi Michael,
Thanks for building this library, its been very useful so far.
Would it be possible to add support for entities that identifiers of type number?
E.g.
Mostly this already works fine, except that I can't use the provided
entityProjecter
which throws a typescript error:Normalizr itself seems to support ids being numbers and strings, so I modified the interfaces in ngrx-normalizr/normalize.d.ts to allow for numbers and this works (for me at least):
I can create a pull request for you if you prefer, but I had trouble getting the karma tests to run... so thought I'd just ask in case this would be a simple change for you.
Thanks again,
Cam