@spark-ui/use-combined-state 0.5.6 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.6.1](https://github.com/adevinta/spark/compare/@spark-ui/use-combined-state@0.6.0...@spark-ui/use-combined-state@0.6.1) (2023-09-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ - doc ([5506203](https://github.com/adevinta/spark/commit/55062039dc67c3532be42a4661540052094163d9))
11
+ - **use-combined-state:** doc ([9ea6c28](https://github.com/adevinta/spark/commit/9ea6c2820c4578daafb394c8242207b5465129a8))
12
+ - **use-combined-state:** missed var observed in hook ([b3fc647](https://github.com/adevinta/spark/commit/b3fc647c5ff679d00f0ce71bd5d4d73fbfc1a2dd))
13
+
14
+ # [0.6.0](https://github.com/adevinta/spark/compare/@spark-ui/use-combined-state@0.5.6...@spark-ui/use-combined-state@0.6.0) (2023-09-28)
15
+
16
+ ### Features
17
+
18
+ - **use-combined-state:** doc ([5032720](https://github.com/adevinta/spark/commit/5032720ff7b50a173cfd8914ff10b093125131ec))
19
+
6
20
  ## [0.5.6](https://github.com/adevinta/spark/compare/@spark-ui/use-combined-state@0.5.5...@spark-ui/use-combined-state@0.5.6) (2023-09-14)
7
21
 
8
22
  ### Bug Fixes
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # useCombinedState
2
+ > @spark-ui/use-combined-state
3
+
4
+ [![storybook](https://img.shields.io/badge/storybook-black?logo=storybook)](https://sparkui.vercel.app/?path=/docs/hooks-usecombinedstate--docs)
5
+ [![documentation](https://img.shields.io/badge/documentation-black?logo=googledocs)](https://sparkui-adv.vercel.app/docs/hooks/useCombinedState)
6
+ [![issue](https://img.shields.io/badge/report%20a%20bug-black?logo=openbugbounty&logoColor=red)](https://github.com/adevinta/spark/issues/new?&projects=4&template=bug-report.yml&assignees=&labels=hook,use-combined-state)
7
+ [![npm](https://img.shields.io/npm/dt/%40spark-ui/use-combined-state?logo=npm&labelColor=black)](https://www.npmjs.com/package/@spark-ui/use-combined-state)
8
+
9
+
10
+ This package is part of the [`@spark-ui`](https://github.com/adevinta/spark) react-js user interface component library project.
11
+
12
+ [![Issues open](https://img.shields.io/github/issues-search/adevinta/spark?query=is%3Aopen%20label%3Ahook%20label%3Ause-combined-state&logo=openbugbounty&logoColor=red&label=issues%20open&color=red)](https://github.com/adevinta/spark/issues?q=is%3Aopen+label%3Ahook+label%3Ause-combined-state)
13
+ [![NPM](https://img.shields.io/npm/l/%40spark-ui%2Fuse-combined-state)](https://github.com/adevinta/spark/blob/main/packages/hooks/use-combined-state/LICENSE.md)
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("lodash.isequal"),c=require("react");exports.useCombinedState=function(r,i,o){const e=r!==void 0,{current:s}=c.useRef(e?r:i),[a,l]=c.useState(i),n=e?r:a,f=c.useCallback((u,b=(t,d)=>!S(t,d))=>{const t=typeof u!="function"?u:u(n);b(n,t)&&!e&&l(t),o&&o(t)},[e,n]);return[n,f,e,s]};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("lodash.isequal"),i=require("react");exports.useCombinedState=function(r,o,u){const e=r!==void 0,{current:s}=i.useRef(e?r:o),[a,l]=i.useState(o),n=e?r:a,f=i.useCallback((c,b=(t,d)=>!S(t,d))=>{const t=typeof c!="function"?c:c(n);b(n,t)&&!e&&l(t),u&&u(t)},[e,n,u]);return[n,f,e,s]};
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import b from "lodash.isequal";
2
2
  import { useRef as d, useState as l, useCallback as C } from "react";
3
- function v(n, r, a) {
4
- const o = n !== void 0, { current: u } = d(o ? n : r), [f, m] = l(r), e = o ? n : f, c = C((s, i = (t, p) => !b(t, p)) => {
5
- const t = typeof s != "function" ? s : s(e);
6
- i(e, t) && !o && m(t), a && a(t);
7
- }, [o, e]);
3
+ function v(n, a, s) {
4
+ const o = n !== void 0, { current: u } = d(o ? n : a), [f, m] = l(a), e = o ? n : f, c = C((r, p = (t, i) => !b(t, i)) => {
5
+ const t = typeof r != "function" ? r : r(e);
6
+ p(e, t) && !o && m(t), s && s(t);
7
+ }, [o, e, s]);
8
8
  return [e, c, o, u];
9
9
  }
10
10
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/use-combined-state",
3
- "version": "0.5.6",
3
+ "version": "0.6.1",
4
4
  "description": "combine controlled-uncontrolled component state by stateful-stateless inner state management",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,7 +18,7 @@
18
18
  "build": "vite build"
19
19
  },
20
20
  "dependencies": {
21
- "@spark-ui/use-mounted-state": "^0.2.4",
21
+ "@spark-ui/use-mounted-state": "^0.3.0",
22
22
  "@types/lodash.isequal": "4.5.6",
23
23
  "lodash.isequal": "4.5.0"
24
24
  },
@@ -36,9 +36,9 @@
36
36
  "category": "hooks"
37
37
  },
38
38
  "bugs": {
39
- "url": "https://github.com/adevinta/spark/issues?q=label%3Ahook+label%3Ause-combined-state"
39
+ "url": "https://github.com/adevinta/spark/issues?q=is%3Aopen+label%3Ahook+label%3Ause-combined-state"
40
40
  },
41
41
  "homepage": "https://sparkui.vercel.app",
42
42
  "license": "MIT",
43
- "gitHead": "318dcc9d11ad26f351ab7f7f8f78bbfad06a4d25"
43
+ "gitHead": "de227a8b264be41733e8889fb99f7fa0404efd53"
44
44
  }
File without changes