question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

looking for better implementation

import * as R from 'ramda'

interface OmitIndexes {
  <T>(indexes: number[], arr: T[]): T[]
  (indexes: number[]): <T>(arr: T[]) => T[]
}
export const omitIndexes: OmitIndexes = R.curryN(2, function(
  indexes: number[],
  arr: any[]
) {
  const reject = R.addIndex(R.reject)
  const rejectedIndexes = (_: any, i: any) => R.contains(i, indexes)
  const ret = reject(rejectedIndexes, arr)
  return ret
})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
char0ncommented, Oct 22, 2017

@BjornMelgaard I wouldn’t worry about that. The point of ramda-adjunct is declarativnes and compos-ability. Or main goal is not performance. IMHO for 90% of use-cases ramda-adjunct is just fine. But if you’re building system where performance is the critical factor, I would not recommend to use ramda-adjunct and create use-case based functions with optimized imperative code inside them, so that I get the most performance from JavaScript engine as I possible can.

0reactions
char0ncommented, Nov 1, 2017

Documented on ramda cookbook. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

omitIndexes.js - Documentation
omitIndexes.js · import · // helpers · const · const · /** · * Returns a partial copy of an array omitting the...
Read more >
MF51382 - LIC-DB Improve query optimization for select/omit indexes
LIC-DB Improve query optimization for select/omit indexes. ... Some queries involving select/omit indexes calculate query
Read more >
pickIndexes · Issue #181 · char0n/ramda-adjunct · GitHub
Check if this function behaves consistently with omitIndexes.
Read more >
@jpex-js/babel-plugin - npm
This is only in terms of resolving a dependency's name, it doesn't actually update the import path. omitIndex. boolean;. When registering a ...
Read more >
Does SQLite automatically create an index for a ... - SQLite Forum
So no index is required for efficient operation. You should always omit indexes on PRIMARY KEY columns, regardless of the type. The best...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found