~evanj/wigly

30d290a4f4360a22be111c501fc99c21fd2ccb52 — Evan M Jones 1 year, 11 months ago 934e6eb
top level fix
2 files changed, 7 insertions(+), 12 deletions(-)

M package.json
M src/main.js
M package.json => package.json +1 -1
@@ 1,6 1,6 @@
{
  "name": "wigly",
  "version": "0.5.1",
  "version": "0.5.2",
  "main": "dist/wigly.es5.js",
  "module": "src/main.js",
  "scripts": {

M src/main.js => src/main.js +6 -11
@@ 17,13 17,10 @@ let debounce = f => {
// funcs
let runEffects = (el, self) => {
  for (let key in self.effects) {
    let effect = self.effects[key];
    if (
      effect &&
      (typeof effect.prev === "undefined" || effect.args.length === 0 || effect.prev.join() !== effect.args.join())
    ) {
      if (effect.cleanup) effect.cleanup();
      self.effects[key] = { prev: effect.args, cleanup: effect.f(el) };
    let { prev, args = [], f, cleanup } = self.effects[key];
    if (typeof prev === "undefined" || args.length === 0 || prev.join() !== args.join()) {
      if (cleanup) cleanup();
      self.effects[key] = { prev: args, cleanup: f(el) };
    }
  }
};


@@ 157,9 154,7 @@ let transformer = async (spec, getEnv, giveEnv, giveVDOM, updateVDOM) => {
};

export let h = (f, props, ...children) => {
  props = props || {};
  children = [].concat.apply([], children);
  return { f, props, children };
  return { f, props: props || {}, children: [].concat.apply([], children) };
};

export let state = init => {


@@ 195,7 190,7 @@ export let render = (f, el) => {

  defer(() => {
    transformer(
      f,
      h(() => f),
      () => ({}),
      () => ({}),
      vdom => {