Skip to content
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

export default #162

Open
rjoydip-zz opened this issue Oct 14, 2018 · 2 comments
Open

export default #162

rjoydip-zz opened this issue Oct 14, 2018 · 2 comments

Comments

@rjoydip-zz
Copy link

rjoydip-zz commented Oct 14, 2018

Feature Request

Great work 👍

Overview

It would be nice to export default functions.

Example:

export function decrement(): i32 {}
export function increment(): i32 {}

export default {
    decrement,
    increment,
};
@ballercat
Copy link
Owner

ballercat commented Oct 14, 2018

Thanks!

Could you talk more about how you would like to use the default export above? Since in JS this module would look something like this already:

// WebAssembly module result
const mod = {
   instance: {
      exports: {
         decrement: fn(),
         increment: fn()
      }
   }
}

So I'm a bit fuzzy on what the utility added by default here.

We could use default for the Module Start Function. Right now that is done by simply naming a function start so using a default keyword might be nicer.

@rjoydip-zz
Copy link
Author

rjoydip-zz commented Oct 20, 2018

I haven't anything in my mind but I am just wondering something like export default function or like es6

export default function count () {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants