<commit_before>Entanglement
==============

> "Spooky action at a distance"

What if an atom could take its values from another atom?

<img src="https://raw.githubusercontent.com/Frozenlock/entanglement/master/quantum-entanglement1.png"
	alt="Entanglement"/>

Same data, different representation.


```clj
 ;; Those two atoms **SHARE THE SAME DATA**
 atom-a
 #<Atom: {:first-name Mike, :last-name Moran, :age 22, :sex M}>

 atom-b
 #<Atom: [Mike 22]>

 ;; Being the same data, you can reset one...

 (reset! atom-b ["Bob" 35])
 ["Bob" 35]
  
 ;; and the other will reflect this change!
  
 atom-a
 #<Atom: {:first-name "Bob", :last-name "Moran", :age 35, :sex "M"}>
```

You can now have an abstaction layer between your state (atom) and
your program.


Usage
-----

Add [![Clojars Project](http://clojars.org/org.clojars.frozenlock/entanglement/latest-version.svg)](http://clojars.org/org.clojars.frozenlock/entanglement) to your `:dependencies` in `project.clj`.

In your namespace declaration: `(:require [entanglement.core :refer [entangle]])`.

To re-create `atom-a` and `atom-b` from the example above:

```clj
;; Let's create the reference atom
(def atom-a (atom {:first-name "Mike" :last-name "Moran" :age 22 :sex "M"}))

;; And now we make an atom taking values from the first atom:
(def atom-b (entangle atom-a<commit_msg>tidy up readme<commit_after>Entanglement
==============

> "Spooky action at a distance"

What if an atom could take its values from another atom?

<img src="https://raw.githubusercontent.com/Frozenlock/entanglement/master/quantum-entanglement1.png"
	alt="Entanglement"/>

Same data, different representation.


```clj
 ;; Those two atoms **SHARE THE SAME DATA**
 atom-a
 #<Atom: {:first-name Mike, :last-name Moran, :age 22, :sex M}>

 atom-b
 #<Atom: [Mike 22]>

 ;; Being the same data, you can reset one...

 (reset! atom-b ["Bob" 35])
 ["Bob" 35]
  
 ;; and the other will reflect this change!
  
 atom-a
 #<Atom: {:first-name "Bob", :last-name "Moran", :age 35, :sex "M"}>
```

You can now have an abstaction layer between your state (atom) and
your program.


Usage
-----

Add this to your project dependencies:

[![Clojars Project](http://clojars.org/org.clojars.frozenlock/entanglement/latest-version.svg)](http://clojars.org/org.clojars.frozenlock/entanglement)


In your namespace declaration: `(:require [entanglement.core :refer [entangle]])`.

To re-create `atom-a` and `atom-b` from the example above:

```clj
;; Let's create the reference atom
(def atom-a (atom {:first-name "Mike" :last-name "Moran" :age 22 :sex "M"}))

;; And now we make an atom taking values from the first atom:
(def atom-b (entangle atom-a
{'fraction_non_alphanumeric': 0.16090225563909774, 'fraction_numerical': 0.009774436090225564, 'mean_word_length': 4.2693069306930695, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '30329', 'n_tokens_mistral': 990, 'n_tokens_neox': 903, 'n_words': 301}