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

next-persist

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-persist - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "next-persist",
"version": "1.0.5",
"version": "1.0.6",
"description": "Bridging the gap between client-side persistence and server-side rendering",

@@ -5,0 +5,0 @@ "main": "src/next-persist.js",

@@ -24,3 +24,2 @@ const nextPersist = {};

nextPersist.getStorage = (key, state) => {
if (typeof window !== 'undefined') {

@@ -27,0 +26,0 @@ const clientState = localStorage.getItem(key);

@@ -1,25 +0,28 @@

import React, { Component } from 'react';
import { Component } from 'react';
import { connect } from 'react-redux';
import { writeStorage } from "next-persist";
import { writeStorage } from './next-persist';
const mapStateToProps = (state) => ({
state: state,
state,
});
class NextPersistWrapper extends Component {
constructor(props) {
super(props)
};
render() {
if (this.props.wrapperConfig.combinedReducers) {
const { allowedKeys } = this.props.wrapperConfig;
const { allowedReducers } = this.props.wrapperConfig;
const allowedKeys = this.props.wrapperConfig.allowedKeys;
const allowedReducers = this.props.wrapperConfig.allowedReducers;
allowedReducers.forEach((allowedReducer, index) => {
allowedReducers.forEach((allowedReducer, index) => {
const nextPersistConfig = {
key: allowedKeys[index],
};
writeStorage(nextPersistConfig, this.props.state[allowedReducer]);
});
} else {
const nextPersistConfig = {
key: allowedKeys[index],
}
writeStorage(nextPersistConfig, this.props.state[allowedReducer]);
})
key: this.props.wrapperConfig.key,
allowList: this.props.wrapperConfig.allowList,
};
writeStorage(nextPersistConfig, this.props.state);
}

@@ -26,0 +29,0 @@ return this.props.children;

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