Add Map and Set support
See original GitHub issueDescription
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:
- Created 3 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @likern @andreialecu
Let me try to rephrase it. What you want to have implemented in Reanimated 2 is support for using
Map
andSet
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
@likern @andreialecu
From what I see apart from the feature request to support
Map
andSet
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 😊