bastilian-tabletools
    Preparing search index...

    Function useTableState

    • Provides an interface for hooks to store their states name-spaced into the tableState in the TableContext

      Parameters

      • namespace: object

        A key to namespace the state under (e.g. 'filters', 'sort')

      • OptionalinitialState: object

        Initial state to put into the table state

      • Optionaloptions: { callbacks?: object; observers?: object; serialiser?: object } = {}

        Options for the state

        • Optionalcallbacks?: object

          An object with callbacks

        • Optionalobservers?: object

          An object with properties of an other state namespace and an object or function returning an object with an desired state should the other state change

        • Optionalserialiser?: object

          A function to serialise the table state and allow access it via the useSerialisedTableState hook

      Returns any[]

      An array with the first item being the tableState, the second a function to set the state and a third optional item with the serialised state if a serialiser was provided