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.

couple questions about example

See original GitHub issue

Hi thanks for this package looks great just have a couple questions about the examples:

a, I know I should just try it but am I right that these android paths mean the SyncExample will not run when deployed on iOS?

const translationGetters = {
  // lazy requires (metro bundler does not support symlinks)
  ar: () => require("../android/app/src/main/assets/translations/ar.json"),
  en: () => require("../android/app/src/main/assets/translations/en.json"),
  fr: () => require("../android/app/src/main/assets/translations/fr.json"),
};

Or maybe I’m misunderstanding something? e.g. Why are these android paths used here considering you’re using require is there a reason these json files don’t just live under the src directory with the rest of the javascript?

(maybe it’s an attempt to keep the translation files out of the bundle to keep them smaller is that it?)

b. Likewise in the SyncExample I notice you memoize the results of i18n.t here:

const translate = memoize(
  (key, config) => i18n.t(key, config),
  (key, config) => (config ? key + JSON.stringify(config) : key),
);

This time I was just curious if you did this because you saw performance issues if you didn’t? i.e. Are you doing this in your example because you recommend doing this in a real app? (I was imagining i18n.t should be fast or otherwise maybe do it’s own memoization without me needing to?)

Thanks,

Darren

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
vikrantnegicommented, Jun 26, 2019

@zoontek Can you add this information somewhere in the docs or README?

Or maybe add comments in the file itself can be of help.

I had to go through all the closed issues to find the answers. I think it will be helpful for others who are trying to find answers about the example projects.

Let me know what you think.

Thanks.

2reactions
zoontekcommented, Mar 28, 2019

@compojoom Because I coudn’t load file on android if they are not in this directory (same happen for fonts with react-native-vector-icons) and metro does not support symlinks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

110 Thought-Provoking Questions for Couples - Oprah Daily
These thought-provoking questions will help strengthen bonds, fight boredom in the relationship, and foster better communication.
Read more >
50 Questions for Couples to Get to Know Each Other Better
1. What are some of the highest-valued things on your bucket list? · 2. Do you want kids? · 3. Where is a...
Read more >
120 Questions For Couples In All Stages Of A Relationship
The best questions for couples focus on compatibility, communication, and intimacy. Here's what to ask to learn more about your partner.
Read more >
53 Relationship Questions That Will Make Your Love Life Better
Here are the 53 questions to ask in a relationship that can change your love life. · 1. What was your first impression...
Read more >
78 Fun Questions to Help You Learn More About Your Partner
Relationship Questions For Couples · What's the biggest lesson you learned from a previous partner? · Who was your first love? · Have...
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