1 type<T1, T2> (Atom<T1>, Atom<T2>) a1 a2 2 def to_atom = 3 let atom = Atom<(T1, T2)> (a1.value, a2.value) 4 let token1 = a1.subscribe { _ x -> atom.set (x, a2.value) @[weak atom] } 5 let token2 = a2.subscribe { _ x -> atom.set (a1.value, x) @[weak atom] } 6 let token = Token.from token1 token2 7 atom.push_token token 8 9 atom.as_readonly 10 11 type<T1, T2, T3> (Atom<T1>, Atom<T2>, Atom<T3>) a1 a2 a3 12 def to_atom = 13 let atom = Atom<(T1, T2, T3)> (a1.value, a2.value, a3.value) 14 let token1 = a1.subscribe 15 { _ x -> atom.set (x, a2.value, a3.value) @[weak atom] } 16 17 let token2 = a2.subscribe 18 { _ x -> atom.set (a1.value, x, a3.value) @[weak atom] } 19 20 let token3 = a3.subscribe 21 { _ x -> atom.set (a1.value, a2.value, x) @[weak atom] } 22 23 let token = Token.from token1 token2 token3 24 atom.push_token token 25 26 atom.as_readonly 27 28 type<T1, T2, T3, T4> (Atom<T1>, Atom<T2>, Atom<T3>, Atom<T4>) a1 a2 a3 a4 29 def to_atom = 30 let atom = Atom<(T1, T2, T3, T4)> (a1.value, a2.value, a3.value, a4.value) 31 let token1 = a1.subscribe 32 { _ x -> atom.set (x, a2.value, a3.value, a4.value) @[weak atom] } 33 34 let token2 = a2.subscribe 35 { _ x -> atom.set (a1.value, x, a3.value, a4.value) @[weak atom] } 36 37 let token3 = a3.subscribe 38 { _ x -> atom.set (a1.value, a2.value, x, a4.value) @[weak atom] } 39 40 let token4 = a4.subscribe 41 { _ x -> atom.set (a1.value, a2.value, a3.value, x) @[weak atom] } 42 43 let token = Token.from token1 token2 token3 token4 44 atom.push_token token 45 46 atom.as_readonly 47 48 type<T1, T2, T3, T4, T5> (Atom<T1>, Atom<T2>, Atom<T3>, Atom<T4>, Atom<T5>) a1 a2 a3 a4 a5 49 def to_atom = 50 let atom = Atom<(T1, T2, T3, T4, T5)> (a1.value 51 a2.value 52 a3.value 53 a4.value 54 a5.value) 55 let token1 = a1.subscribe 56 { _ x -> atom.set (x, a2.value, a3.value, a4.value, a5.value) 57 @[weak atom] } 58 59 let token2 = a2.subscribe 60 { _ x -> atom.set (a1.value, x, a3.value, a4.value, a5.value) 61 @[weak atom] } 62 63 let token3 = a3.subscribe 64 { _ x -> atom.set (a1.value, a2.value, x, a4.value, a5.value) 65 @[weak atom] } 66 67 let token4 = a4.subscribe 68 { _ x -> atom.set (a1.value, a2.value, a3.value, x, a5.value) 69 @[weak atom] } 70 71 let token5 = a5.subscribe 72 { _ x -> atom.set (a1.value, a2.value, a3.value, a4.value, x) 73 @[weak atom] } 74 75 let token = Token.from token1 token2 token3 token4 token5 76 atom.push_token token 77 78 atom.as_readonly 79