Skip to content

Conversation

JDMathew
Copy link
Contributor

@JDMathew JDMathew commented May 29, 2025

Please verify the following:

  • yarn build-and-test:local passes
  • I have added tests for any new features, if relevant
  • README.md (or relevant documentation) has been updated with your changes

Describe your PR

This PR improves the asyncStorage() ignore functionality by adding support for regular expression patterns alongside existing string patterns. It also allows existing string patterns to get a partial match ignoring any keys that partially match.

Changes:

  • Added shouldIgnore() function to handle both string and RegExp patterns
    • String patterns continue to work as before (with substring matching)
    • RegExp patterns enable more sophisticated key filtering (e.g., ^debug_, _cache$)
  • Documentation Updated
    • Updated usage documentation with clear explanation of pattern matching behavior
    • Added examples showing both string and RegExp usage
    • Clarified that strings do substring matching while RegExp uses standard regex matching

Benefits:

  • More flexible filtering options for developers
  • Better control over which AsyncStorage keys are sent to Reactotron
  • Maintains full backward compatibility

Anecdote:
My personal use case was that aws amplify was storing tokens in AsyncStorage under key names I don't have control of this would be something like @MemoryStorage:CognitoIdentityServiceProvider.4589348z&... where I can now pattern match against @MemoryStorage:CognitoIdentityServiceProvider.

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.

1 participant