Socket
Socket
Sign inDemoInstall

state-toggle

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

state-toggle - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

package.json
{
"name": "state-toggle",
"version": "1.0.2",
"version": "1.0.3",
"description": "Enter/exit a state",

@@ -13,2 +13,6 @@ "license": "MIT",

"bugs": "https://github.com/wooorm/state-toggle/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",

@@ -24,9 +28,9 @@ "contributors": [

"browserify": "^16.0.0",
"nyc": "^14.0.0",
"prettier": "^1.12.1",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^4.0.0",
"nyc": "^15.0.0",
"prettier": "^1.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.5.0",
"xo": "^0.24.0"
"tinyify": "^2.0.0",
"xo": "^0.25.0"
},

@@ -33,0 +37,0 @@ "scripts": {

@@ -10,13 +10,13 @@ # state-toggle

## Installation
## Install
[npm][]:
```bash
```sh
npm install state-toggle
```
## Usage
## Use
```javascript
```js
var toggle = require('state-toggle')

@@ -41,5 +41,5 @@

Create a toggle, which when entering toggles `key` on `ctx` (or `this`,
if `ctx` is not given) to `!initial`, and when exiting, sets `key` on
the context back to the value it had before entering.
Create a toggle, which when entering toggles `key` on `ctx` (or `this`, if `ctx`
is not given) to `!initial`, and when exiting, sets `key` on the context back to
the value it had before entering.

@@ -56,4 +56,4 @@ ###### Returns

If no `ctx` was given to `toggle`, the context object (`this`) of `enter()`
is used to toggle.
If no `ctx` was given to `toggle`, the context object (`this`) of `enter()` is
used to toggle.

@@ -60,0 +60,0 @@ ###### Returns

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