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.

[Feature Request] `getStableId` should have a collection as a 2nd parameter

See original GitHub issue

Having getStableId in DataProvider as a function of only index requires to keep the collection hanging somewhere (in the example code you have it hanging in the closure as a local variable of the constructor), then when the collection changes we have to change the getStableId so it will link to the new collection, still this causes other issues.

It would be much much simpler if getStableId has a signature like: (index:number, rows:Array) => any

Then the getStableId logic could be specified just once, for example if I have an array of some objects with some ids it would be as simple as

dataProvider = new DataProvider(
      (r1, r2) => {
        return r1.id !== r2.id
      },
      (index, rows) => {
        return rows[index].id
      }
    )

DataProvider has these rows anyways, so for me it’s strange that I must provide them from the outside.

For example FlatList gives an item at the index in its keyextractor callback. That’s also an option.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

4reactions
naqvitalhacommented, Feb 18, 2020

That makes sense. @arunreddy-flipkart Let’s add this.

3reactions
jittuucommented, Sep 23, 2020

@naqvitalha any news on that? Should I create PR? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: allow for constraints on ordered choice ...
Sometimes categorical or ordered parameters needs to be constrained to remove "symmetries" in the parameter space, e.g. when parameters (1,2) ...
Read more >
Feature Request - Pasting parameters from browser dev tools
I can, for instance, trigger a request from an existing web application and see the parameters I have sent to a rest end...
Read more >
How to Make a Feature Request | Short.Io Help Center
The left request must meet some requirements: 1. A feature has to be useful both for you and other customers. 2. Describe what...
Read more >
What Is a Feature Request? Definition and Examples - Airfocus
There are several ways to ask your customers for feature requests. First, you must have some form of open communication between you and...
Read more >
Cloud Feature Requests | CircleCI Ideas
If you're unsure of which feedback category to select, please reference our guide in the changelog or use the "uncategorized" bucket so we...
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