Here is my simple example:
class Speaker {
constructor(name) {
this.name = name
}
say(msg) {
console.log(`${this.name}: ${msg}`)
}
}
let speaker = new Speaker('John')
speaker.say('hi') // Logs as expected, John: hi
let {say} = speaker
say('hi') // Uncaught TypeError: Cannot read property 'name' of undefined
// Bind fix... but should never use
// say = say.bind(speaker)
Probably a good rule to never pull methods from objects, unless they are stateless.