JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30
  • Score
    100M100P100Q54008F
  • License MIT

Toolkit for developing plugins for Cerebro App

Package Exports

  • cerebro-tools

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cerebro-tools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

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

License

MIT © Alexandr Subbotin