https://github.com/canjs/can-single-reference
Assign a value to a function that can be collected later.
https://github.com/canjs/can-single-reference
Last synced: 12 months ago
JSON representation
Assign a value to a function that can be collected later.
- Host: GitHub
- URL: https://github.com/canjs/can-single-reference
- Owner: canjs
- License: mit
- Created: 2018-05-17T22:20:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T21:57:43.000Z (over 6 years ago)
- Last Synced: 2025-06-16T14:59:33.374Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/can-single-reference
- Size: 20.5 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# can-single-reference
[](https://travis-ci.org/canjs/can-single-reference)
Assign a value to a function that can be collected later
```js
import singleReference from "can-single-reference";
var obj = {};
singleReference.set(obj, 'pet', 'dog');
singleReference.getAndDelete(obj, 'pet') //-> 'dog'
obj //-> {}
```