We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 963c31e commit 27f3e34Copy full SHA for 27f3e34
src/Lib/Search.elm
@@ -10,6 +10,7 @@ module Lib.Search exposing
10
, isEmptyQuery
11
, isEmptyResults
12
, isSearching
13
+ , length
14
, queriesEquals
15
, query
16
, queryEquals
@@ -189,6 +190,25 @@ isEmptyQuery =
189
190
query >> String.isEmpty
191
192
193
+length : Search a -> Maybe Int
194
+length s =
195
+ case s of
196
+ NotAsked _ ->
197
+ Nothing
198
+
199
+ Searching _ (Just r) ->
200
+ Just (SearchResults.length r)
201
202
+ Searching _ Nothing ->
203
204
205
+ Success _ r ->
206
207
208
+ Failure _ _ ->
209
210
211
212
isEmptyResults : Search a -> Maybe Bool
213
isEmptyResults s =
214
case s of
0 commit comments