Skip to content

Instantly share code, notes, and snippets.

@billyvg
Last active June 16, 2017 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billyvg/2eb117b6d7cf4060525245d1d9a763ff to your computer and use it in GitHub Desktop.
Save billyvg/2eb117b6d7cf4060525245d1d9a763ff to your computer and use it in GitHub Desktop.
🤔
// Desired API
const name = await neovim.buffer.name; // neovim.buffer.name((name) => name);
class Buffer {
get name() {}
remove(start, end) {}
}
class Neovim {
get buffer() {
return new Promise((resolve) => resolve(new Buffer()));
}
}
// Instead of this....
const result = await ((await neovim.buffer).name);
const buffer = await neovim.buffer;
const name = await buffer.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment