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

Broken Usage Example in README #7

Open
bsingr opened this issue Mar 19, 2014 · 1 comment
Open

Broken Usage Example in README #7

bsingr opened this issue Mar 19, 2014 · 1 comment

Comments

@bsingr
Copy link

bsingr commented Mar 19, 2014

Hey folks,

the current README gives the following example:

var buffer = binarize.pack(function(object) {  
   ...  
});

However, the pack function expects an object as the first argument and the callback function as the second argument. Also it won’t return a buffer, but invoke the callback function with a DataView.

For me, the following works:

var object;
object = {
  name: 'Eiji Kitamura',
  array: [1, 2, 3],
  object: {
    name: 'Eiji Kitamura',
    hello: 'こんにちは'
  }
};
binarize.pack(object, function(dataView) {
  console.log('packed!', dataView);
  binarize.unpack(dataView.buffer, function(unpacked) {
    console.log('unpacked', unpacked);
  });
});

What is the README describing? Is it just outdated?

Regards,
—dpree

@agektmr
Copy link
Owner

agektmr commented Mar 19, 2014

You are absolutely correct. AudioStreamer has a real world example. I will fix the documentation.
Thanks for reporting!

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