How to use the concat function from ramda

Find comprehensive JavaScript ramda.concat code examples handpicked from public code repositorys.

51
52
53
54
55
56
57
58
59
60
const templatePath = this.templatePath('infrastructure/**/*')
const destinationPath = this.destinationPath()

let ignoreFiles = ['**/.npmignore', '**/.gitignore-template', '**/helm/**']
if (!withRights)
  ignoreFiles = concat(['**/hooks/rights.js', '**/constants/permissions.js', '**/constants/identityUserRoles.js'], ignoreFiles)
if (withMultiTenancy) ignoreFiles = concat(['**/AuthenticationProvider.js'], ignoreFiles)
else ignoreFiles = concat(['**/tenantSelectorStyle.js', '**/tenant', '**/TenantAuthenticationProvider.js'], ignoreFiles)

if (!addQuickStart) ignoreFiles = concat(['**/features/**', '**/README.md'], ignoreFiles)
fork icon8
star icon32
watch icon0

+ 3 other calls in file

381
382
383
384
385
386
387
388
389
390
}

// checksBatch.forEach(async (c) => {
//  debugOuts(`processing tx batch ${c.length} ${headerObj.hash}`)
//  let newMarkedTransactions = await roverHelp.isBeforeSettleHeight(c, roverRpc, headerObj.hash)
//  markedTransactions = (newMarkedTransactions !== false) ? concat(markedTransactions, newMarkedTransactions) : markedTransactions
// })

// if some marked transactions came from settlement check, we have to reindex emblem transactions
if (markedTransactions.length > 0) {
fork icon12
star icon5
watch icon7

+ 4 other calls in file

148
149
150
151
152
153
154
155
156
157

// ${title}

${[
  ...new Set(
    R.concat(
      R.map((t) => (exists(R.path(['type', 'import'], t)) ? `import "${R.path(['type', 'import'], t)}";${EOL}` : ''), rootStruct),
      R.map((i) => (exists(i) ? `import "${i}";${EOL}` : ''), R.map(R.path(['import']), generatedScalars))
    )
  ),
fork icon3
star icon44
watch icon6

87
88
89
90
91
92
93
94
95
96
      '**/db/dbInstanceFactory.js',
      '**/startup/middleware'
    ],
    ignoreFiles
  )
if (!addSubscriptions) ignoreFiles = concat(['**/pubSub/**', '**/subscriptions/**', '**/servers/subscription.js'], ignoreFiles)
if (!addMessaging) ignoreFiles = concat(['**/messaging/**', '**/servers/messaging.js'], ignoreFiles)

if (!withMultiTenancy)
  ignoreFiles = concat(
fork icon3
star icon25
watch icon0

+ 9 other calls in file

42
43
44
45
46
47
48
49
50
51
};
// Don't retrieve files which are modified, new or deleted (because we already have them).
// New are those which have isValidated = false
let filesToIgnore = modifiedFiles || [];
filesToIgnore =
  (deletedFiles && ramda.concat(filesToIgnore, deletedFiles)) ||
  filesToIgnore;
const filesToIgnoreId = filesToIgnore.map((file) => file.id);

if (!ramda.isEmpty(filesToIgnoreId)) {
fork icon2
star icon14
watch icon8

+ 9 other calls in file

4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
            return [null];
        }
    }
};
var mbr2 = function (s, sig) {
    var initial = r.concat(s, sig);
    var typeExp1 = clone(initial);
    var allWords = __assign(__assign({}, dtWords), coreWords);
    var purrur = purr(initial, allWords);
    var typeExp2 = purrur.next().value.stack;
fork icon0
star icon5
watch icon2

+ 4 other calls in file

281
282
283
284
285
286
287
288
289
      return R.mergeAll([offers[id], {
        hotelID: hotelID
      }]);
    }, ids)
  }]);
}, R.concat(prices, getUnusedPricesFromSearchMemory(queryID))));
return R.isEmpty(groupedByCaregory) ? EMPTY_ARRAY : R.map(function (_ref18) {
  var _ref19 = _slicedToArray(_ref18, 1),
      category = _ref19[0];
fork icon0
star icon3
watch icon4

+ 83 other calls in file

41
42
43
44
45
46
47
48
49
50
51
52
  return R.join(',', operators);
};


var addIgnoreOperators = function addIgnoreOperators(query, ignoreOperators) {
  return R.call(R.pipe(stringifyOperators, function (stringifyIgnoreOperators) {
    return query.ignoreOperators = query.ignoreOperators ? R.concat("".concat(query.ignoreOperators, ","), stringifyIgnoreOperators) : stringifyIgnoreOperators;
  }), ignoreOperators);
};


exports.addIgnoreOperators = addIgnoreOperators;
fork icon0
star icon3
watch icon0

25
26
27
28
29
30
31
32
33
34
// appendToArrayByPath :: String -> Object -> Object -> Object
const appendToArrayByPath = doArrayByPath(R.append);
// concatArraysByPath :: String -> Array -> Object -> Object
const concatArraysByPath = doArrayByPath(R.concat);
// reversedConcatArraysByPath :: String -> Array -> Object -> Object
const reversedConcatArraysByPath = doArrayByPath(data => R.concat(R.__, data));
// setByPath :: String -> Object -> Object -> Object
const setByPath = R.curry((objPath, data, object) =>
  R.set(lensStringPath(objPath), data, object)
);
fork icon0
star icon2
watch icon0

12
13
14
15
16
17
18
19
20
21
22
23
24
25
const allUsers = [...privateUsers, ...publicUsers, ...airdropUsers]


function merge (allUsers) {
  const groupByUID = R.groupBy(user => user.uid)


  const concatValues = (k, l, r) => k == 'claim_periods' ? R.concat(l, r) : r


  const reducePeriods = R.reduce(R.mergeWithKey(concatValues), {})


  return R.pipe(groupByUID, R.mapObjIndexed(reducePeriods), R.values)(allUsers)
fork icon0
star icon1
watch icon0

46
47
48
49
50
51
52
53
54
});

const view = R.curry(function (actions, model) {
  const counters = R.map(viewCounter(actions), model.counters);
  return h('div',
    R.concat([h('button.rm', {on: {click: [actions, Action.Remove()]}}, 'Remove'),
              h('button.add', {on: {click: [actions, Action.Insert()]}}, 'Add')], counters)
  );
});
fork icon92
star icon0
watch icon72

682
683
684
685
686
687
688
689
690
691
692
  if (prev.defaults !== next.defaults) {
    throw new Error("Encountered different defaults for message ".concat(_chalk.default.yellow(msgId)) + "\n".concat(_chalk.default.yellow((0, _utils.prettyOrigin)(prev.origin)), " ").concat(prev.defaults) + "\n".concat(_chalk.default.yellow((0, _utils.prettyOrigin)(next.origin)), " ").concat(next.defaults));
  }


  return _objectSpread(_objectSpread({}, next), {}, {
    extractedComments: R.concat(prev.extractedComments, next.extractedComments),
    origin: R.concat(prev.origin, next.origin)
  });
}
/**
fork icon1
star icon0
watch icon0

+ 3 other calls in file

25
26
27
28
29
30
31
32
33
34
35
36
const transformAliases = R.pipe(R.groupBy(R.prop('tune_id')), R.map(R.pluck('alias')))


const mergeTuneAndAliases = (id, tune, aliases) => ({
  id,
  type: tune.type,
  names: R.concat(tune.names, aliases),
})


function run() {
  Promise.all([urls.tunes, urls.aliases].map(getJson))
fork icon0
star icon4
watch icon0

16
17
18
19
20
21
22
23
24
25

const newVirtualRoot = h(`div.${pluginName}`, [
  h("h2", pluginName),
  createMenuVirtualRoot(),
  h("div.center", [
    h("table.pattern", R.concat([h("tr", R.map((element) =>
      h("td", element && String(element)), R.range(0, R.length(data) + 2)))],
    R.mapIndexed((row, rowIndex) =>
      h("tr", R.concat([h("div", h("td", rowsToNotes[rowIndex]))], R.mapIndexed((td, columnIndex) =>
        h("td", h(`div.${model.getClassNameFromCode(td)}`, {
fork icon0
star icon2
watch icon3

+ 3 other calls in file

194
195
196
197
198
199
200
201
202
203
var toUpperCase = s => s.toUpperCase();
var toLowerCase = s => s.toLowerCase();
var strangeConcat = R.converge(R.concat, [toUpperCase, toLowerCase])
strangeConcat("Yodel")
// "YODELyodel"
// 相当于 R.concat('YODEL', 'yodel')
```

### 5.2 柯里化
`curry`:将多参数的函数,转换成单参数的形式。
fork icon0
star icon1
watch icon1

17
18
19
20
21
22
23
24
25

  return R.join('/', folderAddedToPath);
}

function fileTypeInDir(fileType, directory) {
  const anyFileType = R.concat('*.', fileType);

  return shell.ls(R.concat(directory, anyFileType));
}
fork icon1
star icon0
watch icon2

+ 3 other calls in file

8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
 *
 * @example
 *
 *      R.concat([], []); //=> []
 *      R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]
 *      R.concat('ABC', 'DEF'); // 'ABCDEF'
 */
var concat = _curry2(function concat(a, b) {
    if (a == null || !_isFunction(a.concat)) {
        throw new TypeError(toString(a) + ' does not have a method named "concat"');
fork icon0
star icon0
watch icon1

+ 75 other calls in file

1787
1788
1789
1790
1791
1792
1793
1794
1795
* `secondList`.
*
* @example
*
*      R.concat('ABC', 'DEF'); // 'ABCDEF'
*      R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]
*      R.concat([], []); //=> []
*/

fork icon0
star icon0
watch icon2

+ 19 other calls in file

52
53
54
55
56
57
58
59
60
61
  return { ...state, fetching: false, error: action.payload }
}
case "FETCH_EVENTS_FULFILLED": {
  let fetchedEvents = action.payload
  let EventsList = {}
  let concatValues = (k, l, r) => (k == "data" ? R.concat(l, r) : r)

  // loop events and create its structure, also perform deep merge with keys
  for (let event of fetchedEvents) {
    let splitDate = R.split("-", event.Date)
fork icon0
star icon0
watch icon0

39
40
41
42
43
44
45
46
47
48

moves.forEach(m => {
    const {num, from, to} = m;
    const a = R.takeLast(num, stacks[from - 1]);
    stacks[from - 1]= R.take(stacks[from - 1].length - num, stacks[from - 1]);
    stacks[to - 1] = R.concat(stacks[to - 1], a);
    
});

U.logf(stacks);
fork icon0
star icon0
watch icon0

+ 3 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)