本文整理匯總了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;');
});