This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dataProduces = {{state.produces}}; | |
| const dataSnacks = {{state.snacks}}; | |
| const dataMeat = {{state.meat}}; | |
| const searchedData = {{data}}; | |
| if (!searchedData) { | |
| return {produces:dataProduces, snacks:dataSnacks,meat:dataMeat}; | |
| } | |
| function filter(item, value) { | |
| return item.weight.toLowerCase().includes(value) || item.price.toLowerCase().includes(value) || item.product.toLowerCase().includes(value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return {{state.opportunities}}.filter(item => { | |
| return ['Closed—lost', 'Closed—won'].includes(item.fields['Status']); | |
| }).length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const allData = [...{{state.allData}}]; | |
| const page = {{state.offSet}}; | |
| const limit = {{state.limit}}; | |
| return allData.slice(page * limit, page * limit + limit); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function indexEqualsValue(a) { | |
| let left = 0; | |
| let right = a.length - 1; | |
| let mid; | |
| while (left != right) { | |
| mid = Math.floor(((right - left) / 2) + left); | |
| if (mid <= a[mid]) { | |
| right = mid; | |
| } else { |
OlderNewer