wasm-bindgen
wasm-bindgen copied to clipboard
fix(#3297): Allow variant skip
Provides a way to avoid having only C-Style enums allowed with #[wasm_bindgen]
by allowing user to omit an enum Variant, it's then at the user discretion to use #[cfg] directives to reflect this
Can be seen in the example:
#[wasm_bindgen]
pub enum Operation {
INCREMENT,
#[cfg(not(target_arch = "wasm32"))]
#[wasm_bindgen(skip)]
CUSTOM(fn(i32) -> i32),
}
As discussed with Daxpedda on Discord, this is not a good idea.