mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
Reorganize the import_js example
This commit is contained in:
21
examples/import_js/crate/defined-in-js.js
Normal file
21
examples/import_js/crate/defined-in-js.js
Normal file
@ -0,0 +1,21 @@
|
||||
export function name() {
|
||||
return 'World';
|
||||
}
|
||||
|
||||
export class MyClass {
|
||||
constructor() {
|
||||
this._number = 42;
|
||||
}
|
||||
|
||||
get number() {
|
||||
return this._number;
|
||||
}
|
||||
|
||||
set number(n) {
|
||||
return this._number = n;
|
||||
}
|
||||
|
||||
render() {
|
||||
return `My number is: ${this.number}`;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user