本文整理汇总了TypeScript中Immutable.Iterable.isIterable方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Iterable.isIterable方法的具体用法?TypeScript Iterable.isIterable怎么用?TypeScript Iterable.isIterable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Immutable.Iterable
的用法示例。
在下文中一共展示了Iterable.isIterable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
const stateTransformer = (state) => {
const newState = {};
for (let i of Object.keys(state)) {
newState[i] = Iterable.isIterable(state[i]) ? state[i].toJS() : state[i];
}
return newState;
};
示例2: stateTransformer
function stateTransformer(state) {
const newState = {};
for (const i of Object.keys(state)) {
newState[i] = Iterable.isIterable(state[i]) ? state[i].toJS() : state[i];
}
return newState;
}
示例3:
stateTransformer: (state) => {
let newState = {};
for (let i of Object.keys(state)) {
if (Iterable.isIterable(state[i])) {
newState[i] = state[i].toJS();
} else {
newState[i] = state[i];
}
};
return newState;
}
示例4: Object
state => {
const newState = new Object();
for (const i of Object.keys(state)) {
newState[i] = Iterable.isIterable(state[i])
? state[i].toJS()
: state[i];
};
return newState;
}
示例5:
return Object.keys(state).reduce((newState, key) => {
const val = state[key];
newState[key] = Iterable.isIterable(val) ? val.toJS() : val;
return newState;
}, {});
示例6: it
it('should have an immutable initial state', () => {
expect(Iterable.isIterable(initState)).toBe(true);
});