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

Facilitate code-splitting #68

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mesoptier
Copy link

See #67

I thought this PR would be easy, but there are some issues:

  1. Since the current build setup makes it difficult to compile code that is suitable for tree-shaking/code-splitting, I decided to suggest importing the shouldShowPrompt function directly from the src/ directory instead. Not ideal, but it might be OK.
  2. The shouldShowPrompt function will be called twice: once by the developer to determine whether to import the rest of the library, and once by the library to determine whether to show the prompt. This would be fine, except the function has side-effects: it increments the visits counter on each call, meaning that the prompt might be shown too soon or not at all. This is breaking.

What are your thoughts on this, @chrisdancee?

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

Successfully merging this pull request may close these issues.

None yet

1 participant