Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@adil-01/persistent-state
Advanced tools
Readme
Persistent state for react and next js application with client and server side rendering capabilities
In your terminal type.
npm i @adil-01/persistent-state
In your package.json file you can view the new added package @adil-01/persistent-state
usePersistServer
takes 3 arguements.
usePersistServer
falls down if state is not persisted yet.usePersistServer
state is persisted.In your react or next js project import the custom persistent hook
import { usePersistServer } from '@adil-01/persistent-state';
Calling the persistent state hook in your required file
const [persistedState, setPersistedState] = usePersistServer('my_string', '', 5);
persistedState
with name my_string can store string as we given default value as empty string and it will persist for 5 minutes
Updating new value is same as using normal useState in react
setPersistedState('new_string');
const [persistedState, setPersistedState] = usePersistServer('my_number', 100, 7);
persistedState
with name my_number can store number as we given default value as 100 and it will persist for 7 minutes
const [persistedState, setPersistedState] = usePersistServer('my_array', [], 15);
persistedState
with name my_array can store array as we given default value as [] and it will persist for 15 minutes
JavaScript objects are not supported for
usePersistServer
as a state in current version, will be supported in newer versions
FAQs
Persistent state for react and next js application with client and server side rendering capabilities
The npm package @adil-01/persistent-state receives a total of 4 weekly downloads. As such, @adil-01/persistent-state popularity was classified as not popular.
We found that @adil-01/persistent-state demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.