weasel API - v0.8.0
    Preparing search index...

    Function useSelection

    • Default implementation of the getSelection / setSelection adapter contract every action hook (delete, duplicate, nudge, group, ...) requires.

      Owns selection state, exposes a click-policy helper (single vs multi with an extend key), and pre-builds the two adapter methods consumers otherwise hand-roll in every demo:

      const selection = useSelection({ mode: 'multi' });
      const adapter = { ...arrayAdapter({...}), ...selection.adapterMethods };

      Parameters

      Returns SelectionApi