git ssb

1+

Matt McKegg / mutant



Commit 64b0f0923c1d166b21f730eb06c7e34533e6605d

remove transform stubs

Matt McKegg committed on 7/27/2016, 7:40:22 AM
Parent: b715609f8d6393dc7cf2fa7be33b256bffcce3e3

Files changed

transforms/flatten.jsdeleted
transforms/lookup.jsdeleted
transforms/sort.jsdeleted
transforms/uniq.jsdeleted
transforms/flatten.jsView
transforms/lookup.jsView
transforms/sort.jsView
transforms/uniq.jsView
@@ -1,49 +1,0 @@
1-var Value = require('./value')
2-
3-module.exports = Uniq
4-
5-function Uniq (obs) {
6- var object = []
7- update()
8-
9- var observable = Value(object)
10- var broadcast = observable.set
11- obs(refresh)
12-
13- observable.has = function (valueOrObs) {
14- return !!~object.indexOf(valueOrObs)
15- }
16-
17- return observable
18-
19- function update () {
20- var currentValues = object.map(get)
21- var newValues = obs()
22- currentValues.filter(notIncluded, newValues).forEach(removeFrom, object)
23- newValues.filter(notIncluded, currentValues).forEach(addTo, object)
24- }
25-
26- function refresh () {
27- update()
28- broadcast(object)
29- }
30-}
31-
32-function get (value) {
33- return value
34-}
35-
36-function notIncluded (value) {
37- return !~this.indexOf(value)
38-}
39-
40-function removeFrom (item) {
41- var index = this.indexOf(item)
42- if (~index) {
43- this.splice(index, 1)
44- }
45-}
46-
47-function addTo (item) {
48- this.push(item)
49-}

Built with git-ssb-web