An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# can-single-reference

[![Build Status](https://travis-ci.org/canjs/can-single-reference.svg?branch=master)](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 //-> {}
```