2017-04-26 8 views
0

기본적으로 내 앱용으로 만든 "모듈"을 가져오고 앱에있는 변수에 대한 액세스 권한과 일부 도움이되는 기능을 사용하려고합니다. .Typescript & Immutable - 내 보낸 불변 맵의 문제

내 모듈 아래 :

import * as immutable from 'immutable'; 

const treeduxTrunk = immutable.Map(); 

export function setBranch(branchName: string, twigStruct: Object) { 
    treeduxTrunk.set(branchName, twigStruct); 
} 

export default treeduxTrunk; 

내 애플 파일 :

import trunk  = require('../treedux/lib/treeduxTrunk'); 

treeduxTrunk.setBranch('route1', { 
    users: 'nothing', 
    products: 13 
}); 

console.log(treeduxTrunk.default); 

현재의 결과는 다음과 같습니다

지도 {크기 : 0, _root : 정의되지 않은, __ownerID : 정의되지 않음, __hash : 정의되지 않음, __ 변경됨 : false}

나는 그것이, 0보다 큰 크기가 정확해야 기다리고 있었다 나는 1

내가 잘못하고있는 무슨에 어떤 생각을 기다리고 있었다? 사전에

감사합니다,

TF

답변