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

Support external refereferences for event parsing #48

Open
alexprey opened this issue Jan 25, 2021 · 0 comments
Open

Support external refereferences for event parsing #48

alexprey opened this issue Jan 25, 2021 · 0 comments
Labels

Comments

@alexprey
Copy link
Collaborator

Actually the following code returns ****undefined-event**** for dispatched event.

import { EVENT } from 'shared/events';
dispatch(EVENT.MODAL.CLOSE);

This issue is not key goal of the library, but it will be good if we can solve that.

I propose to implement special API to resolve event name in this case. We can implement two-leveled API:

  • FileResolve API - resolve JS import file path to actual file path
  • IdentifierEvaluator API - resolve JS identifier to actual value

FileResolve API

/**
 * @param importPath import path from js file that should be resolved
 * @return content of the target file
 */
function resolve(importPath: string): string;

IdentifierEvaluator API

/**
 * Resolve JS part related to identifier of event to constant string.
 * TBD
 */
function resolve(identifier): string;

Let's discuss that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant