summaryrefslogtreecommitdiff
path: root/iridescence
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-01-04 17:02:27 -0500
committerAdam T. Carpenter <atc@53hor.net>2021-01-04 17:02:27 -0500
commit5dd856cd00c926b7753954b3c07f077128b852d4 (patch)
tree125c9dd2609b6929e9e51339ef663277fd3e035b /iridescence
parent64027a74f9a15d21d6903cb229353bb0185e3a32 (diff)
downloadtheglassyladies-5dd856cd00c926b7753954b3c07f077128b852d4.tar.xz
theglassyladies-5dd856cd00c926b7753954b3c07f077128b852d4.zip
more searching improvements; much faster now
Diffstat (limited to 'iridescence')
-rw-r--r--iridescence/src/store/index.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/iridescence/src/store/index.js b/iridescence/src/store/index.js
index b324bd1..709dc79 100644
--- a/iridescence/src/store/index.js
+++ b/iridescence/src/store/index.js
@@ -17,17 +17,13 @@ export default new Vuex.Store({
},
getters: {
products(state) {
+ let term = state.searchTerm.toLowerCase();
return state.products
.filter(item => {
- let haystack = [
- item.id,
- item.name,
- item.description,
- item.category
- ].join("");
- return haystack
+ return [item.id, item.name, item.description, item.category]
+ .join("")
.toLowerCase()
- .includes(state.searchTerm.toLowerCase());
+ .includes(term);
})
.sort(state.compare);
},