react_redux

package react_redux

Type members

Classlikes

@JSType
trait Action extends Object

Keys should be properties, values, js.Anys. Extend your Action trait from this trait to ensure it has a type property.

Keys should be properties, values, js.Anys. Extend your Action trait from this trait to ensure it has a type property.

case
object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

@JSType
trait ProviderProps extends Object

Create the store in javascript, import it as js.Any then you can set the store in these props.

Create the store in javascript, import it as js.Any then you can set the store in these props.

@native @JSType
trait ReactReduxContextValue[S, A <: Action] extends Object
@native @JSType
trait Store[S, A <: Action] extends Object

Client can obtain the state directly or dispatch an event directly off a store.

Client can obtain the state directly or dispatch an event directly off a store.

Types

type Dispatch[A <: Action] = Function1[A | Dynamic, Unit]

Dispatch an action via the store.

Dispatch an action via the store.

type Listener = Function0[Unit]

A listener in redux is very coarse grained. You receive all events.

A listener in redux is very coarse grained. You receive all events.

type Unsubscriber = Function0[Unit]

Value members

Concrete methods

@native @JSImport("react-redux", "createProvider")
def createProvider(storeKey: String): ReactJSComponent
def dispatch[A <: Action](f: A | Dynamic => Unit): Dispatch[A]

Helper to make type a dispatch function into js.

Helper to make type a dispatch function into js.

@native @JSImport("react-redux", "shallowEqual")
def shallowEqual(lhs: Any, rhs: Any): Boolean

Must have same properties and Object.is used to compared the values of the keys.

Must have same properties and Object.is used to compared the values of the keys.

@native @JSImport("react-redux", "useDispatch")
def useDispatch[A <: Action](): Dispatch[A]

Wrap these in React.useCallback to avoid unnecessary renders.

Wrap these in React.useCallback to avoid unnecessary renders.

@native @JSImport("react-redux", "useSelector")
def useSelector[S, A](selector: Function1[S, A]): A

Read notes on this at https://react-redux.js.org/next/api/hooks.

@native @JSImport("react-redux", "useSelector")
def useSelector[S, A](selector: Function1[S, A], equalityFn: Function2[A, A, Boolean]): A

Read notes on this at https://react-redux.js.org/next/api/hooks.

@native @JSImport("react-redux", "useStore")
def useStore[State, A <: Action](): Store[State, A]

Concrete fields

@native @JSImport("react-redux", "Provider")
val Provider: ReactJSComponent

Default Provider component whose store's name is "store".

Default Provider component whose store's name is "store".