在Javascript中,何時拋出此錯誤?這個錯誤是什麼意思 - Uncaught TypeError:已讀?
index.js
/**
* Created by tushar.mathur on 24/12/15.
*/
'use strict'
const _ = require('lodash')
const Rx = require('rx')
const createDataStore = require('./src/createDataStore')
const fetch = x => Rx.Observable.fromPromise(window.fetch(x))
const parseJSON = x => Rx.Observable.fromPromise(x.json()) // Line: 11 (Where the exception is thrown)
var create = _.partial(createDataStore, fetch, parseJSON)
module.exports = {
create,
// Alias for legacy purposes
createDataStore: create,
createFetchStore: create
}
它是一個天然的諾言錯誤?它意味着什麼? Google顯示未找到結果。
我剛剛遇到這個錯誤。您不需要兩次解決承諾,無論如何都不可能解決承諾的內部屬性。你只需要調用'.then()'兩次。據記錄,支持調用'.then()'兩次。我會看看我是否可以簡化一個例子。我的代碼顯示在這裏:https://tonicdev.com/hippietrail/57611741f056621300ecd1e2 – hippietrail