You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For context: As part of out current codebase we have some model classes that are dynamically registered with our modelFactory, which can fetch the models from our backend.
I just discovered the lovely type maps, and have a slight idea for an improvement.
I would like to be able to declare the "foo" key in the map using the previous constant modelName, to ensure the names doesn't get out of sync. Currently that fails with 'TS1169: A computed property name in an interface must directly refer to a built-in symbol.', which i can understand, as the value could in theory change. However in this case we are dealing with a constant, which should be safe to evaluate on at compile time.
So i short i would like to have the following code instead:
For context: As part of out current codebase we have some model classes that are dynamically registered with our modelFactory, which can fetch the models from our backend.
I just discovered the lovely type maps, and have a slight idea for an improvement.
Our code follows something like this:
I would like to be able to declare the "foo" key in the map using the previous constant modelName, to ensure the names doesn't get out of sync. Currently that fails with 'TS1169: A computed property name in an interface must directly refer to a built-in symbol.', which i can understand, as the value could in theory change. However in this case we are dealing with a constant, which should be safe to evaluate on at compile time.
So i short i would like to have the following code instead:
The text was updated successfully, but these errors were encountered: