本文整理汇总了TypeScript中@statecraft/core.version.vRangeTo方法的典型用法代码示例。如果您正苦于以下问题:TypeScript version.vRangeTo方法的具体用法?TypeScript version.vRangeTo怎么用?TypeScript version.vRangeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@statecraft/core.version
的用法示例。
在下文中一共展示了version.vRangeTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: bitHas
;(async () => {
const qt = store.storeInfo.capabilities.queryTypes
const q: I.Query = bitHas(qt, I.QueryType.AllKV) ? {type: I.QueryType.AllKV, q:true}
: bitHas(qt, I.QueryType.StaticRange) ? {type: I.QueryType.StaticRange, q: [{low: sel(''), high: sel('\xff')}]}
// : qt.has('static range') ? {type: 'static range', q: [{low: sel('mdraw/'), high: sel('mdraw/~')}]}
: {type: I.QueryType.Single, q:true}
const rtype = queryTypes[q.type].resultType
// I would love to just use subResults here, but
for await (const {raw, results, versions} of subResults(rtype.type!, store.subscribe(q))) {
// console.log('results', results)
state.data = rtype.type! === I.ResultType.Range
? new Map(results[0])
: results
// console.log('val', results, state.data, versions)
const v = version.vRangeTo(versions)
if (raw.replace) {
rtype.mapReplace<any, void>(raw.replace.with, (val, k) => {
pushOp(k, {v, replace: val})
})
}
raw.txns.forEach(({txn}) => {
rtype.mapTxn<any, void>(txn, (op, k) => {
pushOp(k, {v, op})
return null as any as I.Op<void> // It'd be better to have a forEach .. .eh.
})
})
state.versions = v
emitter.emit('render')
}
})()
示例2: renderEditor
(params, versions) => renderEditor(null, `raw/${params.name}`, version.vRangeTo(versions))