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

Improve semantics logic to be more generic #14

Open
hugomrdias opened this issue Mar 10, 2022 · 0 comments
Open

Improve semantics logic to be more generic #14

hugomrdias opened this issue Mar 10, 2022 · 0 comments

Comments

@hugomrdias
Copy link
Contributor

I've read through all of this, and it all looks great. I just have one suggestion (which may already be in the pipeline), which is that the logic in semantics.js could probably be made generic for any set of hierarchical actions. So it could be turned into something where maybe instead of a storageSemantics class, there could just be a generic semantics class. So you'd have:

const storageActions = {
  'upload/': {
    '*': {
      'IMPORT',
    }
  }
}

And then you could pass that into the generic semantics class like:

const storageSemantics = sematics(storageActions);

and the tryParsing and tryDelegating methods (and therefore that whole class) then become completely generic and can be used for other cases as well.

You've probably already thought of this, but it's my main suggestion for improvement at the mo.

Originally posted by @adamalton in #3 (comment)

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

No branches or pull requests

2 participants