소스 검색

make_model: be aware of array with empyt slots

master
Bing Sun 5 년 전
부모
커밋
82133fed3b
로그인 계정: sunb GPG 키 ID: F7795F8C590626AB
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. +2
    -5
      src/util/make_model.js

+ 2
- 5
src/util/make_model.js 파일 보기

@@ -61,11 +61,8 @@ export default (options={}) => {
limit = _cache.upstream_limit || _cache.count || Infinity

// be lazy 1: if the data is presented, return the value immediately
//
// note that Array.every(list) == true if list is empty
let _portion = _cache.data.slice(offset, offset+limit)
if (_portion.length > 0 && _portion.every(data => data != undefined))
return Promise.resolve(_portion)
if (this.data(offset, limit).length > 0 && !this.data(offset, limit).includes(undefined))
return Promise.resolve(this.data(offset, limit))

// be lazy 2: if there is a promise, return it if ambient matches or
// cancel it


불러오는 중...
취소
저장