Skip to content

How to use the same custom decorator between custom emitters? #3528

Answered by timotheeguerin
jceipek asked this question in Q&A
Discussion options

You must be logged in to vote

A few things:

  1. I would recommend against using any unamespace types at all in your libraries, this increase the chance of conflict when importing the library which cannot be resolved.
  2. Either way the namespace where the decorator is defined doesn't change this. A decorator can only be defined one in the same scope. The way it works for @minvalue is the decorator and its implementation are in the compiler. Emitters do not change the implementation of the decorator they can just consume the getMinValue function to retrieve the data set by the decorator.

With this in mind you should most likely create a common.tsp file/library where you define those decorators. And this is what you import in…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jceipek
Comment options

Answer selected by jceipek
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants