本文整理汇总了TypeScript中mobx.observable.shallowMap方法的典型用法代码示例。如果您正苦于以下问题:TypeScript observable.shallowMap方法的具体用法?TypeScript observable.shallowMap怎么用?TypeScript observable.shallowMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobx.observable
的用法示例。
在下文中一共展示了observable.shallowMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("includes expansion tracks in the spec if the observable lists them", () => {
// given
const queryData:IQueriedMergedTrackCaseData = {
cases: makeMinimal3Patient3GeneCaseData(),
oql: {
list: [
{gene: 'PIK3CA', oql_line: 'PIK3CA;', parsed_oql_line: {gene: 'PIK3CA', alterations: []}, data: []},
{gene: 'MTOR', oql_line: 'MTOR;', parsed_oql_line: {gene: 'MTOR', alterations: []}, data: []},
]
},
mergedTrackOqlList: [
{
cases: makeMinimal3Patient3GeneCaseData(),
oql: {gene: 'PIK3CA', oql_line: 'PIK3CA;', parsed_oql_line: {gene: 'PIK3CA', alterations: []}, data: []}
},
{
cases: makeMinimal3Patient3GeneCaseData(),
oql: {gene: 'MTOR', oql_line: 'MTOR;', parsed_oql_line: {gene: 'MTOR', alterations: []}, data: []}
}
]
};
const trackIndex = MINIMAL_TRACK_INDEX + 7;
// list expansions for the track key determined before expansion
const preExpandStoreProperties = makeMinimal3Patient3GeneStoreProperties();
const trackKey: string = makeGeneticTrackWith({
sampleMode: false, ...preExpandStoreProperties,
})(queryData, trackIndex).key;
const postExpandStoreProperties = {
...preExpandStoreProperties,
expansionIndexMap: observable.shallowMap({[trackKey]: [0, 1]})
};
// when
const trackFunction = makeGeneticTrackWith({
sampleMode: false,
...postExpandStoreProperties,
});
const track = trackFunction(
queryData,
trackIndex
);
// then
assert.equal(track.expansionTrackList![0].oql, 'PIK3CA;');
assert.equal(track.expansionTrackList![1].oql, 'MTOR;');
});