mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #34630 from rharriso/master
Allow SeamlessImmutable/ImmutableArray.concat to accept an array argument
This commit is contained in:
Vendored
+1
-1
@@ -105,7 +105,7 @@ declare namespace SeamlessImmutable {
|
||||
map<TTarget>(mapFuction: (item: T) => TTarget): Immutable<TTarget[]>;
|
||||
filter(filterFunction: (item: T) => boolean): Immutable<T[]>;
|
||||
slice(start?: number, end?: number): Immutable<T[]>;
|
||||
concat(...arr: T[]): Immutable<T[]>;
|
||||
concat(...arr: Array<T|T[]>): Immutable<T[]>;
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): Immutable<T>;
|
||||
reduce<TTarget>(callbackfn: (previousValue: TTarget, currentValue: T, currentIndex: number, array: T[]) => TTarget, initialValue?: TTarget): Immutable<TTarget>;
|
||||
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): Immutable<T>;
|
||||
|
||||
@@ -120,7 +120,14 @@ interface ExtendedUser extends User {
|
||||
|
||||
// concat. Call the mutable array's 'concat' with the same args to ensure compatability. Make sure the output array is immutable.
|
||||
array.asMutable().concat({ firstName: 'Happy', lastName: 'Cat' });
|
||||
const concat: Immutable.Immutable<User[]> = array.concat({ firstName: 'Happy', lastName: 'Cat' });
|
||||
const concat: Immutable.Immutable<User[]> = array
|
||||
.concat({ firstName: 'Happy', lastName: 'Cat' }, { firstName: 'Silly', lastName: 'Cat' })
|
||||
.concat([{firstName: 'saucy', lastName: 'Cat'}], {firstName: 'Fussy', lastName: 'Cat'})
|
||||
.concat([
|
||||
{firstName: 'Fancy', lastName: 'Cat'},
|
||||
{firstName: 'Sassy', lastName: 'Cat'}],
|
||||
[{firstName: 'Bossy', lastName: 'Cat'}
|
||||
]);
|
||||
concat.asMutable();
|
||||
|
||||
// reduce. Call the mutable array's 'reduce' with the same function to ensure compatability. Make sure the output array is immutable.
|
||||
|
||||
Reference in New Issue
Block a user