1.0.1 • Published 7 years ago

jsets v1.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
7 years ago

jsets

NPM version Build Status Coverage Status

Define Getter and Setter

Install 安装

$ npm install --save jsets

Usage 使用

const jsets = require('jsets')

let data = {}
let instance = {}
instance.set = jsets.createSetter(instance, function (name, value) {
  data[name] = value
}, true)
instance.get = jsets.createGetter(instance, function (name, value) {
  return data[name]
}, true)

instance.set('a', 1)
instance.set({
  a: 1,
  b: 2
})
instance.get(function (b, a) {
  console.log(b, a) // 2, 1
})

License

MIT © zswang

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.5

8 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago