Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-selector

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-selector - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

18

__tests__/index.test.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc