1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Clean up, don't use mixin

PhpStorm/WebStorm doesn't like the mixin syntax, and it's clearer to just use Object.assign.
This commit is contained in:
Toby Zerner
2015-10-13 16:57:18 +10:30
parent 33dd5fff36
commit e3569d39cc
9 changed files with 44 additions and 27 deletions

View File

@@ -34,7 +34,7 @@ export default class Component {
* @param {Array|Object} children
* @public
*/
constructor(props = {}, children) {
constructor(props = {}, children = null) {
if (children) props.children = children;
this.constructor.initProps(props);
@@ -158,6 +158,7 @@ export default class Component {
*
* @see https://lhorie.github.io/mithril/mithril.component.html
* @param {Object} [props] Properties to set on the component
* @param children
* @return {Object} The Mithril component object
* @property {function} controller
* @property {function} view
@@ -165,7 +166,7 @@ export default class Component {
* @property {Object} props The props that were passed to the component
* @public
*/
static component(props = {}, children) {
static component(props = {}, children = null) {
const componentProps = Object.assign({}, props);
if (children) componentProps.children = children;