How to use the indexOf function from ramda

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

47
48
49
50
51
52
53
54
55
56
Create: (model) => R.evolve({todos: R.append(Todo.init(model.nextId, model.newTitle)),
                             nextId: R.inc,
                             newTitle: R.always('')}, model),
Remove: (todo, model) => R.evolve({todos: R.reject(R.eq(todo))}, model),
Modify: (todo, action, model) => {
  const idx = R.indexOf(todo, model.todos)
  return R.evolve({todos: R.adjust(Todo.update(action), idx)}, model)
},
ToggleAll: (model) => {
  const left = R.length(R.reject(R.prop('done'), model.todos)),
fork icon92
star icon0
watch icon2

6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
* @category List
* @sig a -> [a] -> Number
* @param {*} target The item to find.
* @param {Array} xs The array to search in.
* @return {Number} the index of the target, or -1 if the target is not found.
* @see R.indexOf
* @example
*
*      R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=> 6
*      R.lastIndexOf(10, [1,2,3,4]); //=> -1
fork icon0
star icon0
watch icon0

+ 53 other calls in file

12
13
14
15
16
17
18
19
20
21
22
23
const BINARY_OPERATORS = ["+", "-", "*", "/", "&", "|", "&&", "||", "<<", ">>", "==", "===", "!=", "<=", "<",
  "<=>", ">", ">=", "=~", "!~", "^", "**", "%"];


const isSelectorBinaryOperator = selector =>
  R.gte(
    R.indexOf(selector, BINARY_OPERATORS),
    0
  );


const isBinaryOperator = (selector, argumentNodes) =>
fork icon0
star icon0
watch icon0

Other functions in ramda

Sorted by popularity

function icon

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