~evanj/wigly

20830ee0748a9ed2c595f79f850131e2f9df665a — Evan M Jones 5 years ago 30d290a
removing debounce from update
2 files changed, 3 insertions(+), 15 deletions(-)

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

M src/main.js => src/main.js +2 -14
@@ 1,20 1,8 @@
import { h as createElement, patch } from "superfine";

// global
let current;

// util
let defer = Promise.resolve().then.bind(Promise.resolve());

let debounce = f => {
  let inst;
  return () => {
    clearTimeout(inst);
    inst = setTimeout(f);
  };
};

// funcs
let runEffects = (el, self) => {
  for (let key in self.effects) {
    let { prev, args = [], f, cleanup } = self.effects[key];


@@ 55,7 43,7 @@ let transformer = async (spec, getEnv, giveEnv, giveVDOM, updateVDOM) => {
      children: {},
      ...getEnv(f, props.key),
      iter: 0,
      update: debounce(() => {
      update: () => {
        transformer(
          spec,
          getEnv,


@@ 67,7 55,7 @@ let transformer = async (spec, getEnv, giveEnv, giveVDOM, updateVDOM) => {
          },
          updateVDOM
        );
      })
      }
    };

    current = self;