@laserware/stasis
    Preparing search index...

      @laserware/stasis

      Namespaces

      createSagaMiddleware

      Interfaces

      ActionCreator

      An action creator is, quite simply, a function that creates an action. Do not confuse the two terms—again, an action is a payload of information, and an action creator is a factory that creates an action.

      ActionCreatorsMapObject

      Object whose values are action creator functions.

      ActionCreatorWithNonInferrablePayload

      An action creator of type T whose payload type could not be inferred. Accepts everything as payload.

      ActionCreatorWithOptionalPayload

      An action creator of type T that takes an optional payload of type P.

      ActionCreatorWithoutPayload

      An action creator of type T that takes no payload.

      ActionCreatorWithPayload

      An action creator of type T that requires a payload of type P.

      ActionCreatorWithPreparedPayload

      An action creator that takes multiple arguments that are passed to a PrepareAction method to create the final Action.

      ActionReducerMapBuilder

      A builder for an action <-> reducer map.

      AnyAction

      An Action type which accepts any other properties. This is mainly for the use of the Reducer type. This is not part of Action itself to prevent types that extend Action from having an index signature.

      AsyncActionCreator

      Object containing action creators for handling asynchronous actions.

      AsyncTaskExecutor
      Buffer

      Used to implement the buffering strategy for a channel. The Buffer interface defines 3 methods: isEmpty, put and take

      Channel

      A channel is an object used to send and receive messages between tasks. Messages from senders are queued until an interested receiver request a message, and registered receiver is queued until a message is available.

      CombinedSliceReducer

      A reducer that allows for slices/reducers to be injected after initialisation.

      ConfigureStoreOptions

      Options for configureStore().

      CreateListenerMiddlewareOptions
      CreateSliceOptions

      Options for createSlice().

      DevToolsEnhancerOptions
      Dispatch

      A dispatching function (or simply dispatch function) is a function that accepts an action or an async action; it then may or may not dispatch one or more actions to the store.

      EntityAdapter
      EntitySelectors
      EntityState
      EntityStateAdapter
      ForkedTask
      ForkedTaskAPI
      ImmutableStateInvariantMiddlewareOptions

      Options for createImmutableStateInvariantMiddleware().

      ListenerEffectAPI
      ListenerErrorHandler

      Gets notified with synchronous and asynchronous errors raised by listeners or predicates.

      ListenerMiddlewareInstance
      Middleware

      A middleware is a higher-order function that composes a dispatch function to return a new dispatch function. It often turns async actions into actions.

      SerializableStateInvariantMiddlewareOptions

      Options for createSerializableStateInvariantMiddleware().

      SerializedError
      Slice

      The return value of createSlice

      Store

      A store is an object that holds the application's state tree. There should only be a single store in a Redux app, as the composition happens on the reducer level.

      StoreCreator

      A store creator is a function that creates a Redux store. Like with dispatching function, we must distinguish the base store creator, createStore(reducer, preloadedState) exported from the Redux package, from store creators that are returned from the store enhancers.

      SyncTaskExecutor
      Task

      The Task interface specifies the result of running a Saga using fork, middleware.run or runSaga.

      ThunkDispatch

      The dispatch method as modified by React-Thunk; overloaded so that you can dispatch:

      • standard (object) actions: dispatch() returns the action itself
      • thunk actions: dispatch() returns the thunk's return value
      UnknownAction

      An Action type which accepts any other properties. This is mainly for the use of the Reducer type. This is not part of Action itself to prevent types that extend Action from having an index signature.

      Unsubscribe

      Function to remove listener added by Store.subscribe().

      UnsubscribeListenerOptions

      Type Aliases

      Action

      An action is a plain object that represents an intention to change the state. Actions are the only way to get data into the store. Any data, whether from UI events, network callbacks, or other sources such as WebSockets needs to eventually be dispatched as actions.

      ActionFromReducer

      Infer action type from a reducer function.

      ActionFromReducersMapObject

      Infer action union type from a ReducersMapObject.

      ActionMatchingAllOf
      ActionMatchingAnyOf
      Actions

      Defines a mapping from action types to corresponding action object shapes.

      ActionType

      Returns the return type of the action creator.

      AllButLast

      [...A, B] -> A

      AsyncThunk

      A type describing the return value of createAsyncThunk. Might be useful for wrapping createAsyncThunk in custom abstractions.

      AsyncThunkAction

      A ThunkAction created by createAsyncThunk. Dispatching it returns a Promise for either a fulfilled or rejected action. Also, the returned value contains an abort() method that allows the asyncAction to be cancelled from the outside.

      AsyncThunkOptions

      Options object for createAsyncThunk.

      AsyncThunkPayloadCreator

      A type describing the payloadCreator argument to createAsyncThunk. Might be useful for wrapping createAsyncThunk in custom abstractions.

      AsyncThunkPayloadCreatorReturnValue

      A type describing the return value of the payloadCreator argument to createAsyncThunk. Might be useful for wrapping createAsyncThunk in custom abstractions.

      CaseReducer

      A case reducer is a reducer function for a specific action type. Case reducers can be composed to full reducers using createReducer().

      CaseReducerActions

      Derives the slice's actions property from the reducers options

      CaseReducers

      A mapping from action types to case reducers for createReducer().

      CaseReducerWithPrepare

      A CaseReducer with a prepare method.

      Comparer
      Draft

      Convert a readonly type into a mutable type, if possible

      EnhancedStore

      A Redux store returned by configureStore(). Supports dispatching side-effectful thunks in addition to plain actions.

      EntityId
      ForkedTaskExecutor
      IdSelector
      ListenerEffect
      ListenerMiddleware
      Observable

      A minimal observable of state changes. For more information, see the observable proposal: https://github.com/tc39/proposal-observable

      Observer

      An Observer is used to receive data from an Observable, and is supplied as an argument to subscribe.

      OutputSelector

      Represents the actual selectors generated by createSelector.

      PayloadAction

      An action with a string type and an associated payload. This is the type of action returned by createAction() action creators.

      PayloadActionCreator

      An action creator that produces actions with a payload attribute.

      PreloadedStateShapeFromReducersMapObject

      Infer a combined preloaded state shape from a ReducersMapObject.

      PrepareAction

      A "prepare" method to be used as the second parameter of createAction. Takes any number of arguments and returns a Flux Standard Action without type (will be added later) that must contain a payload (might be undefined).

      Reducer

      A reducer is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value

      ReducerFromReducersMapObject

      Infer reducer union type from a ReducersMapObject.

      ReducersMapObject

      Object whose values correspond to different reducer functions.

      SafePromise

      A Promise that will never reject.

      SagaIterator

      Annotate return type of generators with SagaIterator to get strict type-checking of yielded effects.

      Selector

      A standard selector function.

      SliceCaseReducers

      The type describing a slice's reducers option.

      SliceSelectors

      The type describing a slice's selectors option.

      StateFromReducersMapObject

      Infer a combined state shape from a ReducersMapObject.

      StoreEnhancer

      A store enhancer is a higher-order function that composes a store creator to return a new, enhanced store creator. This is similar to middleware in that it allows you to alter the store interface in a composable way.

      Tail

      [H, ...T] -> T

      TaskCancelled
      TaskRejected
      TaskResolved
      TaskResult
      ThunkAction

      A "thunk" action (a callback function that can be dispatched to the Redux store.)

      ThunkMiddleware
      TypedAddListener

      A "pre-typed" version of addListenerAction, so the listener args are well-typed

      TypedRemoveListener

      A "pre-typed" version of removeListenerAction, so the listener args are well-typed

      TypedStartListening

      A "pre-typed" version of middleware.startListening, so the listener args are well-typed

      TypedStopListening

      A "pre-typed" version of middleware.stopListening, so the listener args are well-typed

      UnsubscribeListener
      Update
      ValidateSliceCaseReducers

      Used on a SliceCaseReducers object. Ensures that if a CaseReducer is a CaseReducerWithPrepare, that the reducer and the prepare function use the same type of payload.

      Variables

      __DO_NOT_USE__ActionTypes

      These are private action types reserved by Redux. For any unknown actions, you must return the current state. If the current state is undefined, you must return the initial state. Do not reference these action types directly in your code.

      addListener
      autoBatchEnhancer

      A Redux store enhancer that watches for "low-priority" actions, and delays notifying subscribers until either the queued callback executes or the next "standard-priority" action is dispatched.

      buffers

      Provides some common buffers

      clearAllListeners
      createDraftSafeSelector

      "Draft-Safe" version of reselect's createSelector: If an immer-drafted object is passed into the resulting selector's first argument, the selector will act on the current draft value, instead of returning a cached value that might be possibly outdated if the draft has been modified since.

      createListenerMiddleware
      createNextState

      The produce function takes a value and a "recipe function" (whose return value often depends on the base state). The recipe function is free to mutate its first argument however it wants. All mutations are only ever applied to a copy of the base state.

      createSelector

      Accepts one or more "input selectors" (either as separate arguments or a single array), a single "result function" / "combiner", and an optional options object, and generates a memoized selector function.

      createSlice

      A function that accepts an initial state, an object full of reducer functions, and a "slice name", and automatically generates action creators and action types that correspond to the reducers and state.

      miniSerializeError

      Serializes an error into a plain object. Reworked from https://github.com/sindresorhus/serialize-error

      nanoid
      removeListener

      Functions

      actionChannel

      Creates an effect that instructs the middleware to queue the actions matching pattern using an event channel. Optionally, you can provide a buffer to control buffering of the queued actions.

      all

      Creates an Effect description that instructs the middleware to run multiple Effects in parallel and wait for all of them to complete. It's quite the corresponding API to standard Promise#all.

      apply

      Alias for call([context, fn], ...args).

      applyMiddleware

      Creates a store enhancer that applies middleware to the dispatch method of the Redux store. This is handy for a variety of tasks, such as expressing asynchronous actions in a concise manner, or logging every action payload.

      bindActionCreators

      Turns an object whose values are action creators, into an object with the same keys, but with every function wrapped into a dispatch call so they may be invoked directly. This is just a convenience method, as you can call store.dispatch(MyActionCreators.doSomething()) yourself just fine.

      call

      Creates an Effect description that instructs the middleware to call the function fn with args as arguments.

      cancel

      Creates an Effect description that instructs the middleware to cancel a previously forked task.

      cancelled

      Creates an effect that instructs the middleware to return whether this generator has been cancelled. Typically you use this Effect in a finally block to run Cancellation specific code

      channel

      A factory method that can be used to create Channels. You can optionally pass it a buffer to control how the channel buffers the messages.

      combineReducers

      Turns an object whose values are different reducer functions, into a single reducer function. It will call every child reducer, and gather their results into a single state object, whose keys correspond to the keys of the passed reducer functions.

      compose

      Composes single-argument functions from right to left. The rightmost function can take multiple arguments as it provides the signature for the resulting composite function.

      configureStore

      A friendly abstraction over the standard Redux createStore() function.

      cps

      Creates an Effect description that instructs the middleware to invoke fn as a Node style function.

      createAction

      A utility function to create an action creator for the given action type string. The action creator accepts a single argument, which will be included in the action object as a field called payload. The action creator function will also have its toString() overridden so that it returns the action type.

      createAsyncAction

      Returns an object with an action creator representing the stages of an async action:

      1. Initializing/requesting that the async action be performed
      2. Success if the async action succeeded
      3. Failure if the async action failed
      createImmutableStateInvariantMiddleware

      Creates a middleware that checks whether any state was mutated in between dispatches or during a dispatch. If any mutations are detected, an error is thrown.

      createReducer

      A utility function that allows defining a reducer as a mapping from action type to case reducer functions that handle these action types. The reducer's initial state is passed as the first argument.

      createSelectorCreator

      Creates a selector creator function with the specified memoization function and options for customizing memoization behavior.

      createSerializableStateInvariantMiddleware

      Creates a middleware that, after every state change, checks if the new state is serializable. If a non-serializable value is found within the state, an error is printed to the console.

      createStore
      current

      Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer.

      debounce

      Spawns a saga on an action dispatched to the Store that matches pattern. Saga will be called after it stops taking pattern actions for ms milliseconds. Purpose of this is to prevent calling saga until the actions are settled off.

      delay

      Returns an effect descriptor to block execution for ms milliseconds and return val value.

      findNonSerializableValue
      flush

      Creates an effect that instructs the middleware to flush all buffered items from the channel. Flushed items are returned back to the saga, so they can be utilized if needed.

      fork

      Creates an Effect description that instructs the middleware to perform a non-blocking call on fn

      formatProdErrorMessage
      forwardChannelAction

      Forwards the action emitted from an event channel and pushes it to global state.

      freeze

      Freezes draftable objects. Returns the original object. By default freezes shallowly, but if the second argument is true it will freeze recursively.

      getContext

      Creates an effect that instructs the middleware to return a specific property of saga's context.

      isActionCreator

      Returns true if value is an RTK-like action creator, with a static type property and match method.

      isAllOf

      A higher-order function that returns a function that may be used to check whether an action matches all of the supplied type guards or action creators.

      isAnyOf

      A higher-order function that returns a function that may be used to check whether an action matches any one of the supplied type guards or action creators.

      isAsyncThunkAction

      A higher-order function that returns a function that may be used to check whether an action was created by an async thunk action creator.

      isDraft

      Returns true if the given value is an Immer draft

      isFluxStandardAction

      Returns true if value is an action with a string type and valid Flux Standard Action keys.

      isFulfilled

      A higher-order function that returns a function that may be used to check whether an action was created by an async thunk action creator, and that the action is fulfilled.

      isImmutableDefault

      The default isImmutable function.

      isPending

      A higher-order function that returns a function that may be used to check whether an action was created by an async thunk action creator, and that the action is pending.

      isPlain

      Returns true if the passed value is "plain", i.e. a value that is either directly JSON-serializable (boolean, number, string, array, plain object) or undefined.

      isPlainObject
      isRejected

      A higher-order function that returns a function that may be used to check whether an action was created by an async thunk action creator, and that the action is rejected.

      isRejectedWithValue

      A higher-order function that returns a function that may be used to check whether an action was created by an async thunk action creator, and that the action is rejected with value.

      join

      Creates an Effect description that instructs the middleware to wait for the result of a previously forked task.

      legacy_createStore

      Creates a Redux store that holds the state tree.

      lruMemoize

      Creates a memoized version of a function with an optional LRU (Least Recently Used) cache. The memoized function uses a cache to store computed values. Depending on the maxSize option, it will use either a singleton cache (for a single entry) or an LRU cache (for multiple entries).

      original

      Get the underlying object that is represented by the given draft

      put

      Creates an Effect description that instructs the middleware to dispatch an action to the Store. This effect is non-blocking, any errors that are thrown downstream (e.g. in a reducer) will bubble back into the saga.

      putResolve

      Just like put but the effect is blocking (if promise is returned from dispatch it will wait for its resolution) and will bubble up errors from downstream.

      race

      Creates an Effect description that instructs the middleware to run a Race between multiple Effects (this is similar to how Promise.race([...]) behaves).

      retry

      Creates an Effect description that instructs the middleware to call the function fn with args as arguments. In case of failure will try to make another call after delay milliseconds, if a number of attempts < maxTries.

      select

      Creates an effect that instructs the middleware to invoke the provided selector on the current Store's state (i.e. returns the result of selector(getState(), ...args)).

      setContext

      Creates an effect that instructs the middleware to update its own context. This effect extends saga's context instead of replacing it.

      spawn

      Same as fork(fn, ...args) but creates a detached task. A detached task remains independent from its parent and acts like a top-level task. The parent will not wait for detached tasks to terminate before returning and all events which may affect the parent or the detached task are completely independents (error, cancellation).

      take

      Creates an Effect description that instructs the middleware to wait for a specified action on the Store. The Generator is suspended until an action that matches pattern is dispatched.

      takeEvery

      Spawns a saga on each action dispatched to the Store that matches pattern.

      takeLatest

      Spawns a saga on each action dispatched to the Store that matches pattern. And automatically cancels any previous saga task started previously if it's still running.

      takeLeading

      Spawns a saga on each action dispatched to the Store that matches pattern. After spawning a task once, it blocks until spawned saga completes and then starts to listen for a pattern again.

      takeMaybe

      Same as take(pattern) but does not automatically terminate the Saga on an END action. Instead all Sagas blocked on a take Effect will get the END object.

      throttle

      Spawns a saga on an action dispatched to the Store that matches pattern. After spawning a task it's still accepting incoming actions into the underlying buffer, keeping at most 1 (the most recent one), but in the same time holding up with spawning new task for ms milliseconds (hence its name - throttle). Purpose of this is to ignore incoming actions for a given period of time while processing a task.

      unwrapResult
      weakMapMemoize

      Creates a tree of WeakMap-based cache nodes based on the identity of the arguments it's been called with (in this case, the extracted values from your input selectors). This allows weakMapMemoize to have an effectively infinite cache size. Cache results will be kept in memory as long as references to the arguments still exist, and then cleared out as the arguments are garbage-collected.