From 0a3bc6fdf4cca35861a7583fe568ff87b496102e Mon Sep 17 00:00:00 2001 From: octuplesakura Date: Wed, 27 Mar 2019 17:33:29 +0800 Subject: [PATCH] refact: Small part of the grammar optimization --- src/thunk.ts | 2 +- src/vnode.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/thunk.ts b/src/thunk.ts index 9650412..dcd850c 100644 --- a/src/thunk.ts +++ b/src/thunk.ts @@ -55,7 +55,7 @@ export const thunk = function thunk(sel: string, key?: any, fn?: any, args?: any } return h(sel, { key: key, - hook: {init: init, prepatch: prepatch}, + hook: {init, prepatch}, fn: fn, args: args }); diff --git a/src/vnode.ts b/src/vnode.ts index 1a6d4a7..37512d9 100644 --- a/src/vnode.ts +++ b/src/vnode.ts @@ -42,8 +42,7 @@ export function vnode(sel: string | undefined, text: string | undefined, elm: Element | Text | undefined): VNode { let key = data === undefined ? undefined : data.key; - return {sel: sel, data: data, children: children, - text: text, elm: elm, key: key}; + return {sel, data, children, text, elm, key}; } export default vnode;