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

rko

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rko - npm Package Versions

134

0.5.21

Diff

Changelog

Source

0.5.21

  • Commands will now use the id property from the command object as a fallback if the id argument is not provided to setState.

    // `onStateDidChange` will be called with (state, "added_message")
    addMessage(newMessage) {
      this.setState({
        before: { message: this.state.message },
        after: { message: newMessage }
      }, "added_message")
    }
    
    // `onStateDidChange` will be called with (state, "cleared_message")
    clearMessage() {
      this.setState({
        id: "cleared_message",
        before: { message: this.state.message },
        after: { message: "" }
      })
    }
    
    // `onStateDidChange` will be called with (state, "flipped_message")
    reverseMessage() {
      this.setState({
        id: "reversed_message",
        before: { message: this.state.message },
        after: { message: [...this.state.message].reverse().join("") }
      }, "flipped_message")
    }
    
  • Changes stack from private to protected. This allows extending classes to make the stack public if they wish.

    class Example extends StateManager {
      get history() {
        return this.stack
      }
    }
    
steveruizok
published 0.5.20 •

Changelog

Source

0.5.20

  • Adds the onReady method, which is called when the state loads persisted data.
steveruizok
published 0.5.19 •

Changelog

Source

0.5.19

  • Makes the persist method protected rather than private, so that you can manually call persist from sub-class methods.
steveruizok
published 0.5.18 •

Changelog

Source

0.5.18

  • Fix export bugs related to esm
  • Adds Patch and Command type exports
steveruizok
published 0.5.17 •

steveruizok
published 0.5.16 •

Changelog

Source

0.5.16

  • Adds missing calls to onStateWillChange and onStateDidChange during replaceState.
steveruizok
published 0.5.15 •

Changelog

Source

0.5.15

  • Adds onStateWillChange
  • Adds tests for onStateWillChange
steveruizok
published 0.5.14 •

Changelog

Source

0.5.14

  • Adds onStateDidChange
  • Adds tests for onStateDidChange
  • Adds id to Command (optional)
  • Adds id parameter (optional) to methods that change state
  • Fixes return type for StateManager methods, now correctly chainable
steveruizok
published 0.5.13 •

Changelog

Source

0.5.13

  • Updates resetState so that it returns to the provided initial state, rather than the restored persisted state.
  • Deep copies the initial state (or restored persisted state) to prevent clashes from mutations.
  • Adds additional tests.
steveruizok
published 0.5.12 •

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