0
아래 코드 :Immutable.js를 ES6 클래스와 함께 사용하는 방법은 무엇입니까?
class A {constructor(v) {
this.v = v;
}}
const a = fromJS(new A({a: 42, someOtherSubTree: {}}));
const aMod = a.updateIn(['v', 'a'], x=>43);
중 & hellip;
TypeError: a.set is not a function
나는 그러나 "포장"접근 방식이 제안하는 방법 그래서 나는 확실하지 않다 '타이프 라이터'로 태그가 this related question을 발견했습니다
이TypeError: a.updateIn is not a function
set
더 단순한를 또한 실패 : 실패 순수한 ES6으로 변환됩니다.
수업을 하시겠습니까? 엄격한 구조와 메소드가 필요한 경우 Immutable.js'Record's https://facebook.github.io/immutable-js/docs/#/Record/Record를 사용할 수 있습니다. 여기 좋은 예가 https : //gist.github.com/prenaudin/f1cad2bda2f2334459f8b006449c91e4#file-1-models-task-js – Strajk