How to use the @remirror/core-helpers.take function in @remirror/core-helpers

To help you get started, we’ve selected a few @remirror/core-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / packages / test-keyboard / src / test-keyboard.ts View on Github external
public mod({ text, options = Object.create(null) }: TextInputParams) {
    let modifiers = text.split(/-(?!$)/);
    let result = modifiers[modifiers.length - 1];
    modifiers = take(modifiers, modifiers.length - 1);

    if (result === 'Space') {
      result = ' ';
    }

    const info = getModifierInformation({ modifiers, isMac: this.isMac });

    this.fireModifierEvents(info, 'keydown');
    this.type({ text: result, options: { ...options, ...info } });
    this.fireModifierEvents(info, 'keyup');

    return this;
  }
github ifiokjr / remirror / packages / multishift / src / multishift-utils.ts View on Github external
export const addItems = (
  currentItems: GItem[],
  newItems: GItem[],
  getItemId: GetItemId,
  multiple?: boolean,
) => (multiple ? uniqueBy([...currentItems, ...newItems], getItemId, true) : take(newItems, 1));