Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@neocoast/neox
Advanced tools
npm install --save @neocoast/neox
or
yarn add @neocoast/neox
import fromJS from '@neocoast/neox';
const state = fromJS({
loading: false,
username: null,
});
console.log(intialState);
// {values: Map(2), toJS: ƒ, set: ƒ}
console.log(state.values);
// Map(2) {"loading" => false, "username" => null}
console.log(state.toJS());
// {loading: false, username: null}
// Change username
state.set('username', 'tintef');
console.log(state.toJS());
// {loading: false, username: 'tintef'}
// Chained set calls
state.set('username', 'maurocen').set('loading', true);
console.log(state.toJS());
// {loading: false, username: 'maurocen'}
In order to correctly see your reducers chart in Redux's devtools, the following needs to be done:
const devToolsExtension = window.__REDUX_DEVTOOLS_EXTENSION__ ? (
window.__REDUX_DEVTOOLS_EXTENSION__({
serialize: {
replacer: (key, value) => value && value.toJS ? value.toJS() : value
},
})
) : (
(f) => f
);
ImmutableJS doesn't work well with Redux's hooks -- see this issue.
Neox doesn't change the values references inside the object retrieved by the toJS()
method and this allows the following comparisson:
const state = fromJS({ arr: ['tintef', 'maurocen'] });
console.log(state.toJS().arr === state.toJS().arr);
// true
If you're currently using Immutable
, an effect triggered by changes on state.toJS().arr
will be triggered even when arr
hasn't changed at all. This is because Immutable
's toJS()
function changes the references of the internal values. Neox
doesn't change the internal references unless .set
is called. So your effect will only be triggered when you set a new array to it.
Icons made by Freepik from www.flaticon.es
FAQs
Data structure supporting new redux hooks
The npm package @neocoast/neox receives a total of 3 weekly downloads. As such, @neocoast/neox popularity was classified as not popular.
We found that @neocoast/neox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.