Skip to content

Commit

Permalink
updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Mar 15, 2020
1 parent 667a52c commit 9c17d7c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
35 changes: 20 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@ var augmentor = (function (exports) {
}
}

var umap = (function (_) {
return {
// About: get: _.get.bind(_)
// It looks like WebKit/Safari didn't optimize bind at all,
// so that using bind slows it down by 60%.
// Firefox and Chrome are just fine in both cases,
// so let's use the approach that works fast everywhere 👍
get: function get(key) {
return _.get(key);
},
set: function set(key, value) {
return _.set(key, value), value;
}
};
});

/*! (c) Andrea Giammarchi - ISC */
var state = null; // main exports

Expand Down Expand Up @@ -233,13 +249,7 @@ var augmentor = (function (exports) {
};
}; // useState

var updates = new WeakMap();

var setRaf = function setRaf(hook) {
var update = reraf();
updates.set(hook, update);
return update;
};
var updates = umap(new WeakMap());

var hookdate = function hookdate(hook, ctx, args) {
hook.apply(ctx, args);
Expand All @@ -263,7 +273,7 @@ var augmentor = (function (exports) {

if (i === length) state.length = stack.push({
$: typeof value === 'function' ? value() : value,
_: asy ? updates.get(hook) || setRaf(hook) : hookdate
_: asy ? updates.get(hook) || updates.set(hook, reraf()) : hookdate
});
var ref = stack[i];
return [ref.$, function (value) {
Expand Down Expand Up @@ -329,15 +339,10 @@ var augmentor = (function (exports) {


var effects = new WeakMap();
var fx = umap(effects);

var stop = function stop() {};

var setFX = function setFX(hook) {
var stack = [];
effects.set(hook, stack);
return stack;
};

var createEffect = function createEffect(asy) {
return function (effect, guards) {
var i = state.i++;
Expand Down Expand Up @@ -379,7 +384,7 @@ var augmentor = (function (exports) {
stop: stop
};
state.length = stack.push(_info);
(effects.get(hook) || setFX(hook)).push(_info);
(fx.get(hook) || fx.set(hook, [])).push(_info);

var _invoke2 = function _invoke2() {
_info.clean = effect();
Expand Down
2 changes: 1 addition & 1 deletion min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@ungap/custom-event": "^0.2.0",
"@ungap/weakset": "^0.1.5",
"augmentor": "^2.1.5",
"augmentor": "^2.1.6",
"disconnected": "^0.2.1"
},
"devDependencies": {
Expand All @@ -44,7 +44,7 @@
"drop-babel-typeof": "^1.0.3",
"http-server": "^0.12.1",
"istanbul": "^0.4.5",
"rollup": "^2.0.3",
"rollup": "^2.0.6",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-node-resolve": "^5.2.0",
"uglify-es": "^3.3.9"
Expand Down

0 comments on commit 9c17d7c

Please sign in to comment.