Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding native APIs that are sync, when RN is inherently async #4

Open
mattapperson opened this issue Aug 2, 2015 · 2 comments
Open

Comments

@mattapperson
Copy link

As facebook/react-native#332 sync based APIs can and will come up. I plan on knocking out the tableview issue, but that still does not solve the real platform issue... APIs that are designed to be synchronous including those baked into iOS (and soon android) as well as those created by 3rd parties.

I think RN needs to create helper functions, macros... whatever... to make working with APIs such as these easier.

@brentvatne
Copy link
Owner

Indeed this is a tough problem to deal with. Let's use this issue to gather some examples of synchronous APIs and discuss possible solutions. I know that @vjeux has some interesting ideas for how to handle this by using Animated.Value to make native the owner of values that are shared between Native and JS, and that value is opaque and can only then be accessed asynchronously via the JS side. For example you could have an opaque scroll position value on a ScrollView. See this conversation

@brentvatne
Copy link
Owner

One suggestion I heard for this was to have some way to describe logic in JS that could be ported to native and run synchronously, like shaders for example.

@brentvatne brentvatne changed the title Suggestion: Binding nation APIs that are sync, when RN is inherently async Binding native APIs that are sync, when RN is inherently async Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants