本文整理汇总了TypeScript中@dojo/shim/array.from函数的典型用法代码示例。如果您正苦于以下问题:TypeScript from函数的具体用法?TypeScript from怎么用?TypeScript from使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了from函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: render
protected render() {
const { activeFilter, todos, toggleTodo, editTodo, updateTodo, removeTodo } = this.properties;
const todoItems = arrayFrom(todos.entries()).filter(([ , value ]) => filter(activeFilter, value));
return v('ul', { classes: this.theme(css.todoList) }, todoItems.map(([ key, todo ]) => {
return w(TodoItem, { key, todo, toggleTodo, editTodo, removeTodo, updateTodo });
}));
}
示例2: v
render() {
const { properties: { activeFilter, todos, toggleTodo, editTodo, updateTodo, removeTodo } } = this;
const todoItems = arrayFrom(todos.entries()).filter(([ , value ]) => filter(activeFilter, value));
return v('ul', { id: 'todo-list', classes: this.theme(css.todoList) }, todoItems.map(([ key, todo ]) => {
return w<TodoItem>('todo-item', { key, todo, toggleTodo, editTodo, removeTodo, updateTodo });
}));
}
示例3: Value
handle.destroy();
assert.isFalse(registry.has('id'));
}
},
'#values'() {
const value1 = new Value();
const value2 = new Value();
const value3 = new Value();
const registry = new IdentityRegistry<Value>();
registry.register('id1', value1);
registry.register('id2', value2);
registry.register('id3', value3);
assert.deepEqual(arrayFrom(registry.values()), [ value1, value2, value3 ]);
},
'#ids'() {
const value1 = new Value();
const value2 = new Value();
const value3 = new Value();
const registry = new IdentityRegistry<Value>();
registry.register('id1', value1);
registry.register('id2', value2);
registry.register('id3', value3);
assert.deepEqual(arrayFrom(registry.ids()), [ 'id1', 'id2', 'id3' ]);
},