@hookstate/core
Advanced tools
Comparing version 3.0.7 to 3.0.8
@@ -381,5 +381,5 @@ import React from 'react'; | ||
* | ||
* The `useState` forces a component to rerender everytime, when: | ||
* The `useState` forces a component to rerender every time, when: | ||
* - a segment/part of the state data is updated *AND only if* | ||
* - this segement was **used** by the component during or after the latest rendering. | ||
* - this segment was **used** by the component during or after the latest rendering. | ||
* | ||
@@ -422,3 +422,3 @@ * For example, if the state value is `{ a: 1, b: 2 }` and | ||
* - a segment/part of the state data is updated *AND only if* | ||
* - this segement was **used** by the component during or after the latest rendering. | ||
* - this segment was **used** by the component during or after the latest rendering. | ||
* | ||
@@ -447,3 +447,3 @@ * You can use as many local states within the same component as you need. | ||
* It can be also used in class-based React components. It is also | ||
* particularly usefull for creating *scoped* states. | ||
* particularly useful for creating *scoped* states. | ||
* | ||
@@ -450,0 +450,0 @@ * [Learn more...](https://hookstate.js.org/docs/using-without-statehook) |
@@ -224,3 +224,3 @@ import React from 'react'; | ||
}(Error)); | ||
function isNoProxyInititializer() { | ||
function isNoProxyInitializer() { | ||
try { | ||
@@ -234,3 +234,3 @@ var used = new Proxy({}, {}); | ||
} | ||
var IsNoProxy = isNoProxyInititializer(); | ||
var IsNoProxy = isNoProxyInitializer(); | ||
var DowngradedID = Symbol('Downgraded'); | ||
@@ -384,3 +384,3 @@ var SelfMethodsID = Symbol('ProxyMarker'); | ||
}); | ||
// if an array of object is about to loose existing property | ||
// if an array of objects is about to loose existing property | ||
// we consider it is the whole object is changed | ||
@@ -400,3 +400,3 @@ // which is identified by upper path | ||
}); | ||
// if an array of object is about to be extended by new property | ||
// if an array of objects is about to be extended by new property | ||
// we consider it is the whole object is changed | ||
@@ -1132,3 +1132,9 @@ // which is identified by upper path | ||
var link = new StateMethodsImpl(state, path, state.get(path), state.edition, update); | ||
React.useEffect(function () { | ||
// useLayoutEffect here instead of useEffect because of this issue: | ||
// https://github.com/avkonst/hookstate/issues/165#issuecomment-824670930 | ||
// and very likely this issue: | ||
// https://github.com/avkonst/hookstate/issues/186 | ||
// and probably this issue: | ||
// https://github.com/avkonst/hookstate/issues/145 | ||
React.useLayoutEffect(function () { | ||
subscribeTarget.subscribe(link); | ||
@@ -1135,0 +1141,0 @@ return function () { |
@@ -230,3 +230,3 @@ 'use strict'; | ||
}(Error)); | ||
function isNoProxyInititializer() { | ||
function isNoProxyInitializer() { | ||
try { | ||
@@ -240,3 +240,3 @@ var used = new Proxy({}, {}); | ||
} | ||
var IsNoProxy = isNoProxyInititializer(); | ||
var IsNoProxy = isNoProxyInitializer(); | ||
var DowngradedID = Symbol('Downgraded'); | ||
@@ -390,3 +390,3 @@ var SelfMethodsID = Symbol('ProxyMarker'); | ||
}); | ||
// if an array of object is about to loose existing property | ||
// if an array of objects is about to loose existing property | ||
// we consider it is the whole object is changed | ||
@@ -406,3 +406,3 @@ // which is identified by upper path | ||
}); | ||
// if an array of object is about to be extended by new property | ||
// if an array of objects is about to be extended by new property | ||
// we consider it is the whole object is changed | ||
@@ -1138,3 +1138,9 @@ // which is identified by upper path | ||
var link = new StateMethodsImpl(state, path, state.get(path), state.edition, update); | ||
React.useEffect(function () { | ||
// useLayoutEffect here instead of useEffect because of this issue: | ||
// https://github.com/avkonst/hookstate/issues/165#issuecomment-824670930 | ||
// and very likely this issue: | ||
// https://github.com/avkonst/hookstate/issues/186 | ||
// and probably this issue: | ||
// https://github.com/avkonst/hookstate/issues/145 | ||
React.useLayoutEffect(function () { | ||
subscribeTarget.subscribe(link); | ||
@@ -1141,0 +1147,0 @@ return function () { |
{ | ||
"name": "@hookstate/core", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "The flexible, fast and extendable state management for React that is based on hooks and state usage tracking.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
326391
2798