Skip to content

Instantly share code, notes, and snippets.

@dariocravero
Created February 1, 2016 14:00
Show Gist options
  • Save dariocravero/584e13c6a6e9ebc5ffd7 to your computer and use it in GitHub Desktop.
Save dariocravero/584e13c6a6e9ebc5ffd7 to your computer and use it in GitHub Desktop.
export async function load({id, src, onEnd}) {
const node = await createNode(src, onEnd);
nodes[id] = node;
return {
duration: node.duration()
};
}
export function load({id, src, onEnd}) {
return createNode(src, onEnd)
.then(node => nodes[id] = node)
.then(node => ({
duration: node.duration()
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment