本文整理匯總了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' ]);
},