- From: Jimmy Wärting <notifications@github.com>
- Date: Sun, 30 Sep 2018 12:26:22 -0700
- To: whatwg/encoding <encoding@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 30 September 2018 19:26:43 UTC
This is a minor issue, but i think it's a more convenient to pass the `encode` into functions and use the same encoder thought out a serie of task. Instead of creating new instances or small anonymous function `.then(str => encoder.encode(str))`. A simple fix would be something like `let encode = new TextEncoder(); encode = encode.encode.bind(encode)` ```js somePromise .then(new TextEncoder().encode) .then(console.log) ``` now it just throws `TypeError: Illegal invocation` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/encoding/issues/159
Received on Sunday, 30 September 2018 19:26:43 UTC