typeless

typeless

  • Docs
  • API
  • Github

›API Reference

Introduction

  • Quick Start
  • Motivation
  • Examples
  • Starters Kits
  • Roadmap

Using typeless

  • HMR
  • Code-Splitting

API Reference

  • createModule
  • createSelector
  • useActions
  • useMappedState
  • useSelector
  • ChainedReducer
  • Epic
  • Handle
  • Rx

API Reference (router)

  • createUseRouter
  • RouterActions
  • getRouterState
  • Link

API Reference (form)

  • createForm
  • FormActions

useSelector(selector[, equalityFn])

React Hook for accessing the Selector result.

Arguments

  1. selector: Selector- a selector function created with createSelector.
  2. equalityFn?: (a: unknown, b: unknown) => boolean - the function for checking that new result value of Selector equals the old value. For more info: useMappedState

Returns

{object} - the object returned by Selector.

Example

Full example: createSelector

// components/TodoList.tsx
function TodoList() {
  // use your selector with useSelector
  const todos = useSelector(getTodos);
  return (
    <div>
      {todos.map(todo => (
        <Todo todo={todo} key={todo.id} />
      ))}
    </div>
  );
}
← useMappedStateChainedReducer →
typeless
Docs
Getting StartedAPI Reference
Community
Spectrum
More
GitHub
Copyright © 2020 Łukasz Sentkiewicz