-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
from index.d.ts:
export interface SArray<T> {... }
export interface SDataArray<T> extends SArray<T>I would proffered this be written as:
export interface SArray<T> extends ReadonlyArray<T> {
// only S-Array specific function mentioned here
}
export interface SDataArray<T> extends SArray<T>, Array<T> {
// only S-Array specific function mentioned here
}Obviously the implication are
- The additional function and their overloads presented in Readonly/Array would need to be implemented in S-Array.
- Existing functions with different signatures would need to be changed or overloads added
- I experienced this issues with .map function, when used with more than 1 argument.
The reason is this would allow general (generic) function to be written that can handled both types. Also converting code to-and-from standard array / s-array.
What is your opinion?
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels