Skip to content

Commit

Permalink
Added panics instead of print
Browse files Browse the repository at this point in the history
  • Loading branch information
nilathedragon committed Jan 15, 2019
1 parent 1737615 commit 622d0c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions skip.go
@@ -1,7 +1,5 @@
package reactive

import "fmt"

// Skip will ignore a specified amount of updates
// and will pass through all following
func Skip(count int) func(Observable, Subjectable) {
Expand All @@ -14,8 +12,9 @@ func Skip(count int) func(Observable, Subjectable) {
}
})

// This error will never happen. But for gamma rays sake.
if err != nil {
fmt.Println(err)
panic(err)
}
}
}
Expand All @@ -33,8 +32,9 @@ func SkipEvery(count int) func(Observable, Subjectable) {
}
})

// This error will never happen. But for gamma rays sake.
if err != nil {
fmt.Println(err)
panic(err)
}
}
}
8 changes: 4 additions & 4 deletions take.go
@@ -1,7 +1,5 @@
package reactive

import "fmt"

// Take automatically unsubscribes an observable after
// the given amount of times it has been updated
func Take(count int) func(Observable, Subjectable) {
Expand All @@ -17,8 +15,9 @@ func Take(count int) func(Observable, Subjectable) {
}
})

// This error will never happen. But for gamma rays sake.
if err != nil {
fmt.Println(err)
panic(err)
}
}
}
Expand All @@ -36,8 +35,9 @@ func TakeEvery(count int) func(Observable, Subjectable) {
}
})

// This error will never happen. But for gamma rays sake.
if err != nil {
fmt.Println(err)
panic(err)
}
}
}

0 comments on commit 622d0c3

Please sign in to comment.