當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript observable.shallowMap方法代碼示例

本文整理匯總了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;');
 });
開發者ID:agarwalrounak,項目名稱:cbioportal-frontend,代碼行數:44,代碼來源:OncoprintUtils.spec.ts


注:本文中的mobx.observable.shallowMap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。