-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
From https://www.reddit.com/r/rust/comments/1i0hcrt/comment/m72u90d/
One thing that irks me is that it uses the equivalent of eval() and string interpolation for very basic things, like getting a property. Wouldn't it be possible to add an API like Reflect? Especially Reflect.get() and Reflect.apply() would be super useful. Instead of
Js::invoke("console.log({})", &[e.to_string().into()]) Js::invoke("{}.textContent = 'Click'", &[button.into()]) Js::invoke("return {}[{}]", &[e.into(), "keyCode".into()])You could write something like
Reflect::apply("console.log", &[e.to_string().into()]) Reflect::set(button, "textContent", "Click") Reflect::get(e, "keyCode")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request