Socket
Socket
Sign inDemoInstall

react-fluxible

Package Overview
Dependencies
8
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.2 to 6.0.3

8

lib/index.d.ts

@@ -1,2 +0,6 @@

import { Store } from 'fluxible-js';
export declare function createFluxibleHook<StoreType>(store: Store<StoreType>): (mapStates: (store: StoreType) => Partial<StoreType>) => Partial<StoreType>;
import { FluxibleStore } from 'fluxible-js';
export declare function createFluxibleHook<StoreType>(
store: FluxibleStore<StoreType>
): (
mapStates: (store: StoreType) => Partial<StoreType>
) => Partial<StoreType>;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFluxibleHook = void 0;
const react_1 = __importDefault(require("react"));
const react_1 = require("react");
function createFluxibleHook(store) {
return function useFluxibleStore(mapStates) {
const [states, setState] = react_1.default.useState(() => mapStates(store.store));
const [states, setState] = (0, react_1.useState)(() => mapStates(store.store));
/**

@@ -16,11 +13,15 @@ * useEffect seems to be delayed causing

*/
const removeObserver = react_1.default.useMemo(() => {
const removeObserver = (0, react_1.useMemo)(() => {
return store.addObserver(() => {
setState(mapStates(store.store));
}, Object.keys(mapStates(store.store)));
}, [
},
// leave blank, don't watch mapStates callback
]);
// eslint-disable-next-line
[]);
// remove observer on unmount
react_1.default.useEffect(() => removeObserver, []);
(0, react_1.useEffect)(() => removeObserver,
// leave blank, don't watch mapStates callback
// eslint-disable-next-line
[]);
return states;

@@ -27,0 +28,0 @@ };

{
"name": "react-fluxible",
"version": "6.0.2",
"version": "6.0.3",
"description": " Connector for react-js and fluxible-js.",

@@ -17,12 +17,12 @@ "main": "lib/index.js",

"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/eslint-parser": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/core": "^7.17.0",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/preset-flow": "^7.16.0",
"@babel/preset-react": "^7.16.0",
"@types/react": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@typescript-eslint/typescript-estree": "^5.2.0",
"@babel/preset-flow": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@types/react": "^17.0.39",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"@typescript-eslint/typescript-estree": "^5.10.2",
"babel-core": "^6.26.3",

@@ -35,13 +35,13 @@ "babel-eslint": "^10.1.0",

"babel-preset-react": "^6.24.1",
"eslint": "^8.1.0",
"eslint": "^8.8.0",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-module-resolver": "^1.4.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"jest": "^27.3.1",
"lint-staged": "^11.2.6",
"prettier": "^2.4.1"
"jest": "^27.5.0",
"lint-staged": "^12.3.3",
"prettier": "^2.5.1"
},

@@ -80,3 +80,6 @@ "scripts": {

]
},
"dependencies": {
"fluxible-js": "^6.0.8"
}
}

@@ -11,2 +11,6 @@ ![npm](https://img.shields.io/npm/dt/react-fluxible) ![npm](https://img.shields.io/npm/dm/react-fluxible) ![npm](https://img.shields.io/npm/dw/react-fluxible)

# Demo
https://user-images.githubusercontent.com/21032419/139817756-c5bf348e-7941-4000-9205-a165ee3ddccc.mp4
# Install

@@ -13,0 +17,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc