New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gsw

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

gsw

get, set, watch

latest
Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
5
-50%
Maintainers
1
Weekly downloads
 
Created
Source

gsw

get, set, watch

github npm:version typescript ci:status Coverage Status document:typedoc license browserslist code style: prettier

Usage

/**
 * To prepare of using the `gsw`
 * ```sh
 * yarn add gsw
 * ```
 */
import gsw from 'gsw';

or

<script src="https://unpkg.com/gsw/gsw.js"></script>
<script>
  // Can use the `gsw` here.
</script>

Example

const value = gsw({
  foo: 'str',
  bar: 123,
  baz: true
});

// get
expect(value('foo')).toBe('str');

// set
value('bar', 456);
expect(value('bar')).toBe(456);

// listener
value('baz', (newValue, oldValue) => {
  console.log(`newValue: ${newValue}, oldValue: ${oldValue}`);
});
value('baz', false);
// newValue: false, oldValue: true
value('baz', false);
value('baz', true);
// newValue: true, oldValue: false

Edit @gsw/example

Keywords

object

FAQs

Package last updated on 13 Apr 2019

Did you know?

Socket

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