Objective Redux

Redux made better, objectively.

SagaBuilder

class SagaBuilder<Payload>

Builder that is returned by the [[StatelessController]] to create and store a saga.

Template Parameters

<Payload>
The payload that the action and the saga will use.

register

public register(): ActionFn<Payload>

Completes the builder and adds the saga to the objectiveStore.

Returns

ActionFn
An action for calling the saga.

withAddressableName

public withAddressableName(name: string): SagaBuilder<Payload>

Adds a specific name to the saga so that it can be addressed without calling the specific action returned by this builder.

Parameters

name: string
The name/type of the action.

Returns

SagaBuilder
An instance of the SagaBuilder.

withEffect

public withEffect(effectBuilder: EffectBuilder): SagaBuilder<Payload>

Adds a watcher to the saga.
Objective Redux provides some build in configurations, or custom one can be built by using the below paradigm.

Parameters

effectBuilder: EffectBuilder
The builder function for the saga watcher. This can be generating using one of the configure
functions, such as configureTakeLatest or configureDebounce.

Returns

SagaBuilder
An instance of the SagaBuilder.

Examples

// Example of a customer configuration
export function configureExample(configurationParameters) {
  // provides
  //   config.name the which is the action name targeting the saga
  //   config.sagaFn the saga function being wrapped
  return function EXAMPLE(config) {
    return function* () {
      yield exampleEffect(config.name, config.sagaFn);
    };
  };
 }