Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamataryo/symbol-function
https://github.com/kamataryo/symbol-function
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kamataryo/symbol-function
- Owner: kamataryo
- Created: 2018-06-09T06:09:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-09T22:56:11.000Z (over 6 years ago)
- Last Synced: 2024-12-18T05:39:51.266Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SymbolFunction
[![npm version](https://badge.fury.io/js/%40kamataryo%2Fsymbol-function.svg)](https://badge.fury.io/js/%40kamataryo%2Fsymbol-function)
[![Build Status](https://travis-ci.org/kamataryo/symbol-function.svg?branch=master)](https://travis-ci.org/kamataryo/symbol-function)SymbolFunction can be used as a function and bracket suffix safely.
## install
```shell
$ yarn add @kamataryo/symbol-function
# or
$ npm insall @kamataryo/symbol-function
```## usage
```javascript
// it works as a Function'
const func = new SymbolFunction(() => 'xyz')
func() // 'xyz'
})// it can be used as bracket suffix
const func1 = new SymbolFunction(() => {})
const func2 = new SymbolFunction(() => {})
const obj = {}
obj[func1] = 123
obj[func2] = 234obj[func1] // 123
obj[func2] // 234
```