當我走到低谷客戶通道代碼(phoenix.js文件中),我看到它使用ES6。示例代碼:鳳凰渠道polyfills
let chan = socket.chan("rooms:123", {token: roomToken})
// chan.on("new_msg", msg => console.log("Got message", msg))
// $input.onEnter(e => {
// chan.push("new_msg", {body: e.target.val})
// .receive("ok", (message) => console.log("created message", message))
// .receive("error", (reasons) => console.log("create failed", reasons))
// .after(10000,() => console.log("Networking issue. Still waiting..."))
this.onError(reason => {
this.socket.log("channel", `error ${this.topic}`, reason)
this.state = CHAN_STATES.errored
this.rejoinTimer.setTimeout()
})
這意味着它不會在IE和Safari本機運行(至少)。我不應該使用某種polyfills? 什麼是最好的方法/ polyfill? 此外,我認爲polyfills蓋類/ /出租的印象......但沒有箭頭的功能/新字符串插值。我應該改變這些嗎?
明白了。再次感謝你。 –