-
Notifications
You must be signed in to change notification settings - Fork 21
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
Mapping enum types to enum values #16
Comments
#17 should resolve this when merged by creating an new type called |
You probably want to export a ie export const EntityErrorEnum = {
UNKNOWN: 0,
NOT_EXIST: 1,
EXISTED: 2
};
// usage
import {EntityErrorEnum, type EntityErrorType} from 'path/to/thrift/def.thrift';
function (error: EntityErrorType) {
if (error === EntityErrorEnum.UNKNOWN) {
// do something
} else {
// do something else
}
} |
Yea I ran into that when attempting to use it. Should be fixed in the latest version of the pull request #17 |
Resolved in 0.3.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When translating thrift enums like so:
Thrift2Flow generates two objects
Is there a way in flow to map these back to one another through flow or through this tool? Would it make more sense for this tool to generate out a single object like so?
The text was updated successfully, but these errors were encountered: