Socket
Socket
Sign inDemoInstall

@rpldy/simple-state

Package Overview
Dependencies
5
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rpldy/simple-state

deep proxy object, so it's only updateable through an update method


Version published
Weekly downloads
9.4K
decreased by-7.01%
Maintainers
1
Install size
86.0 kB
Created
Weekly downloads
 

Changelog

Source

1.8.0 (2024-02-22)

Features

  • upload-preview - expose getPreviewsLoaderHook. ER #646.

Bug fixes

  • upload-drop-zone - fix drag&drop over child elements. Fix for #652.

Internal

  • all - upgrade most deps to latest (flow, lerna, vite, etc.)

Readme

Source
npm version circleci status codecov status bundlephobia badge rpldy storybook

Simple State

Internal package

Deep proxies an object so it is only updateable through an update callback. outside an updater, it is impossible to make changes

It only proxies simple objects (not maps or sets) and arrays

It doesnt create new references and doesnt copy over anything

Original object is changed!

The best place to get started is at our: React-Uploady Documentation Website

Installation

#Yarn: 
   $ yarn add @rpldy/simple-state 

#NPM:
   $ npm i @rpldy/simple-state

Important!

All exports of this package are considered internal API and may change/disappear in any version: patch/minor/major

Example

import createState from "@rpldy/simple-state"

const { state, update } = createState({
    arr: [1,2,3]
});

state.arr.push(4);
console.log(state.arr); // print [1,2,3]

update((state) => {
    state.arr.push(4);
});

console.log(state.arr); // print [1,2,3,4]

FAQs

Last updated on 22 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc