Skip to content

📦 Toolkit for developing plugins for Cerebro App

Notifications You must be signed in to change notification settings

cerebroapp/cerebro-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cerebro-tools

Library package for Cerebro app plugin developers, that includes most used functions

Documentation

Memoize

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. Check their documentation for more details.

Search

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 – main repo for Cerebro app;
  • Memoizee – Complete memoize/cache solution for JavaScript.

License

MIT © Alexandr Subbotin

About

📦 Toolkit for developing plugins for Cerebro App

Topics

Resources

Stars

Watchers

Forks