-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Making JSObject hashable #158
Comments
Yeah, that could work, but we'd need to make @swiftwasm/jskit-team WDYT about this approach? Does |
Thanks for the tip! This seems to work just fine for now: extension JSObject : Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(ObjectIdentifier(self))
}
} |
Yeah, it may work in trivial scenarios, but until I'm 100% sure there's no way one can have multiple different When we do have that certainty, I guess it makes sense to add some What exactly are you trying to achieve with it? Do you just want a dictionary or a set of |
I just need a dictionary with |
I think using |
Is there anything that would prevent using the object id for hashing in
JSObject
? Since hash values in Swift change between sessions anyway, I can't immediately see why using id would be a bad idea. All that would be needed to makeJSObject
conform toHashable
is to add:The text was updated successfully, but these errors were encountered: