async-selector
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -157,4 +157,4 @@ import createAsyncSelector from '../src/index'; | ||
employees(state); | ||
employees(state, true); | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
employees.forceUpdate(state); | ||
expect(count).toBe(3); | ||
@@ -169,4 +169,4 @@ }); | ||
employees(state); | ||
employees(state, true); | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
employees.forceUpdate(state); | ||
expect(count).toBe(2); | ||
@@ -181,5 +181,5 @@ }); | ||
employees(state); | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
setTimeout(() => { | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
try { | ||
@@ -240,5 +240,5 @@ expect(count).toBe(1); | ||
setTimeout(() => { | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
setTimeout(() => { | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
setTimeout(() => { | ||
@@ -264,3 +264,3 @@ try { | ||
setTimeout(() => { | ||
employees(state, true); | ||
employees.forceUpdate(state); | ||
setTimeout(() => { | ||
@@ -267,0 +267,0 @@ try { |
@@ -74,8 +74,8 @@ 'use strict'; | ||
var func = function func(state) { | ||
var forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
var internal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
var func = function func(state, props) { | ||
var forceUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | ||
var internal = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; | ||
var mapped = selectors.map(function (f) { | ||
return f(state); | ||
return f(state, props); | ||
}); | ||
@@ -85,7 +85,2 @@ var changed = forceUpdate || hasChanged(oldInputs, mapped); | ||
/* Handle throttling / debouncing if required */ | ||
if (throttle !== null && f === null) { | ||
f = throttle(function (state) { | ||
return func(state, true, true); | ||
}); | ||
} | ||
if (f !== null && internal === false) { | ||
@@ -128,2 +123,10 @@ f(state, forceUpdate); | ||
}; | ||
if (throttle !== null && f === null) { | ||
f = throttle(function (state, props) { | ||
return func(state, props, true, true); | ||
}); | ||
} | ||
func.forceUpdate = function (state, props) { | ||
return func(state, props, true, false); | ||
}; | ||
return func; | ||
@@ -130,0 +133,0 @@ } |
{ | ||
"name": "async-selector", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Select values from databases using asynchronous selectors.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143297
918