tanb / codable

Codable base class for TypeScript
2 stars 2 forks source link

Race condition? #23

Closed josephjoeljo closed 7 months ago

josephjoeljo commented 7 months ago

I am trying to implement this at scale, so I am referring to many other classes that are codable as codable types in many classes. I get this error on one of the codable types: [Error] ReferenceError: Cannot access uninitialized variable. Module Code (OrganizationModels.ts:31)

I've moved the offending codable type into the same file and it seems to have fixed the issue. What would be a good way to fix this instead of having all of my models in one file.

tanb commented 7 months ago

Thank you for using this library. I believe this project doesn't support Race Conditions.

It was written 4 years ago, so it doesn't support newer versions of TypeScript either.

I'm not sure if I can resolve it, but I'm very interested in exploring it further. Could you please share a simple reproducible code snippet if available?

josephjoeljo commented 7 months ago

I am unable to replicate it at a small scale. Just create a bunch of classes and have them refer to each other. What I meant by race condition was that some things were happening out of order. I might create my own version of this with the latest version of typescript.