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.

Add Map and Set support

See original GitHub issue

Description

This support is required to store information about pages (rows grouped by pages) for Animated.ScrollView.

Now, if I’m correct, there is no such support. And Map were treated as usual object (or was undefined) inside worklet, if was created through useSharedValue(new Map())

Caveats

Motivation

Track page ids and efficiently retrieve rows by this id (for adding or deleting rows on demand).

Also to use to store animated references.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jkadamczykcommented, Jan 28, 2022

Hi @likern @andreialecu

Let me try to rephrase it. What you want to have implemented in Reanimated 2 is support for using Map and Set JS objects as a value passed to SharedValue from Reanimated 2.

That would be a feature request we can accept, but I can’t guarantee we will implement something like this. Correct me if I’m wrong here

0reactions
jkadamczykcommented, Jan 28, 2022

@likern @andreialecu

From what I see apart from the feature request to support Map and Set you tried to work around this issue by using a JS Object {'key': 'value'} and found some issues with it. If you still have issues, could you please create a Bug report issue separately and provide a small repro with it if you still have problems with Reanimated 2 working as desired?

Thanks for sparing your time and have a nice day 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Map.prototype.set() - JavaScript - MDN Web Docs - Mozilla
The set() method adds or updates an entry in a Map object with a specified key and a value.
Read more >
Map and Set - The Modern JavaScript Tutorial
Map. Map is a collection of keyed data items, just like an Object . ... The main feature is that repeated calls of...
Read more >
Understanding Map and Set Objects in JavaScript | DigitalOcean
You can add values to a map with the set() method. The first argument will be the key, and the second argument will...
Read more >
19. Maps and Sets - Exploring JS
The following sections explain each of these differences. 19.3.1 WeakMap keys are objects #. If you add an entry to a WeakMap then...
Read more >
Map and Set | Immer - GitHub Pages
Since version 6 support for Maps and Sets has to be enabled explicitly by calling enableMapSet() once when starting your application.
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