Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cerebroapp/cerebro-tools
📦 Toolkit for developing plugins for Cerebro App
https://github.com/cerebroapp/cerebro-tools
cerebro cerebro-plugin javascript toolkit
Last synced: about 2 months ago
JSON representation
📦 Toolkit for developing plugins for Cerebro App
- Host: GitHub
- URL: https://github.com/cerebroapp/cerebro-tools
- Owner: cerebroapp
- Created: 2016-11-30T23:49:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-26T20:19:54.000Z (almost 7 years ago)
- Last Synced: 2024-10-03T07:11:11.948Z (3 months ago)
- Topics: cerebro, cerebro-plugin, javascript, toolkit
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 10
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# cerebro-tools
> Library package for [Cerebro](http://www.cerebroapp.com) app plugin developers, that includes most used functions
## Documentation
### Memoize```js
const { memoize } = require('cerebro-tools');const fetchResults = memoize(() => {
// Your long running function
})
```Use `memoize` function from `cerebro-tools` for your long-running functions, like API-requests.
Under the hood it just uses [memoizee](https://github.com/medikoo/memoizee). Check their documentation for more details.
### Search
```js
const { search } = require('cerebro-tools');// Filter your results array
const results = search(arr, 'something', (el) => el.key);// Display filtered results
display(results);
```Simple function to search in your collection:
`search = (items, term, toString = (item) => item) => {}`
Where
* `items` – your array;
* `term` – search term;
* `toString` – function to convert your collection item to string.## Related
- [Cerebro](http://github.com/KELiON/cerebro) – main repo for Cerebro app;
- [Memoizee](https://github.com/medikoo/memoizee) – Complete memoize/cache solution for JavaScript.## License
MIT © [Alexandr Subbotin](http://asubbotin.ru)