1 | import { concat, flip } from 'ramda';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Returns the result of concatenating the given lists or strings.
|
---|
5 | *
|
---|
6 | * Note: R.concat expects both arguments to be of the same type, unlike
|
---|
7 | * the native Array.prototype.concat method.
|
---|
8 | * It will throw an error if you concat an Array with a non-Array value.
|
---|
9 | * Dispatches to the concat method of the second argument, if present.
|
---|
10 | *
|
---|
11 | * @func concatRight
|
---|
12 | * @memberOf RA
|
---|
13 | * @since {@link https://char0n.github.io/ramda-adjunct/1.11.0|v1.11.0}
|
---|
14 | * @category List
|
---|
15 | * @sig [a] -> [a] -> [a]
|
---|
16 | * @sig String -> String -> String
|
---|
17 | * @param {Array|String} firstList The first list
|
---|
18 | * @param {Array|String} secondList The second list
|
---|
19 | * @return {Array|String} A list consisting of the elements of `secondList`
|
---|
20 | * followed by the elements of `firstList`.
|
---|
21 | * @see {@link http://ramdajs.com/docs/#concat|R.concat}
|
---|
22 | * @example
|
---|
23 | *
|
---|
24 | * RA.concatRight('ABC', 'DEF'); //=> 'DEFABC'
|
---|
25 | * RA.concatRight([4, 5, 6], [1, 2, 3]); //=> [1, 2, 3, 4, 5, 6]
|
---|
26 | * RA.concatRight([], []); //=> []
|
---|
27 | */
|
---|
28 | const concatRight = flip(concat);
|
---|
29 |
|
---|
30 | export default concatRight;
|
---|