Package Exports
- app.let
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (app.let) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
app.let
"app.let" polyfills 'let' for Object props. Additionally, it also provides a 'private' Map for Objects
applet = require('app.let')()
By default trying to reset an Object's property that is a 'let' property does not throw errors. To throw errors:
applet = require('app.let')({strict:true})
The 'app.let' Symbol('@let') can also be customized:
applet = require('app.let')({ symbol:'custom-symbol' })
app.let is class Leter
class Leter extends Map
get symbol() => Symbol
get name() => Symbol string value
get privates() => Leter private map
get isLeter() => true
def(obj) => obj w/ let defined
priv(obj) => obj w/ private Map defined
sudo(obj) => get or set if not defined obj's private Map
app.let use:
applet=require('app.let')()
obj=applet.def( { hello:'world' } )
obj.let('hello')
obj.hello = 'saturn'
obj.hello // returns 'world' or if strict throws Error
applet.sudo(obj).set('hello','private world')
applet.sudo(obj).get('hello') // 'private world'
Notes:
- app.let uses Object.watch or watch (sans unwatch) polyfill from https://gist.github.com/eligrey/384583