How to use the redux-loop.Effects.call function in redux-loop

To help you get started, we’ve selected a few redux-loop examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
function numberString(x: number, y: string) {
  return { type: "numberString", x, y };
}

// ok
const callEffect: Effect = Effects.call(zeroArg);

// ok
Effects.call(string, "one");

// ok
Effects.call(numberString, 1, "two");

// $ExpectError
Effects.call(string, 1);

// $ExpectError
Effects.call(string, 1);

// ok
Effects.call(string, "one", "two");

//
// Effects.promise
//

function asyncActionCreator(x: string, y: number) {
  return Promise.resolve({
    type: "asyncAction",
    x,
    y
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
//
// Effects.lift
//

function nestedAction(time: Date, action: { type: $Subtype }) {
  return { type: "NESTED_ACTION", payload: action, time };
}

function nestedActionWrongArgOrder(
  action: { type: $Subtype },
  time: Date
) {
  return { type: "NESTED_ACTION", payload: action, time };
}

const nestedEffect = Effects.call(zeroArg);

// ok
Effects.lift(nestedEffect, nestedAction, new Date());

// $ExpectError
Effects.lift(nestedEffect, nestedActionWrongArgOrder, new Date());
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
});
}

// ok
Effects.promise(asyncActionCreator, "one", 2);

// $ExpectError
Effects.promise(asyncActionCreator, 1, "two");

//
// Effects.batch
//

// ok
Effects.batch([
  Effects.call(zeroArg),
  Effects.promise(asyncActionCreator, "one", 2)
]);

//
// Effects.lift
//

function nestedAction(time: Date, action: { type: $Subtype }) {
  return { type: "NESTED_ACTION", payload: action, time };
}

function nestedActionWrongArgOrder(
  action: { type: $Subtype },
  time: Date
) {
  return { type: "NESTED_ACTION", payload: action, time };
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
const callEffect: Effect = Effects.call(zeroArg);

// ok
Effects.call(string, "one");

// ok
Effects.call(numberString, 1, "two");

// $ExpectError
Effects.call(string, 1);

// $ExpectError
Effects.call(string, 1);

// ok
Effects.call(string, "one", "two");

//
// Effects.promise
//

function asyncActionCreator(x: string, y: number) {
  return Promise.resolve({
    type: "asyncAction",
    x,
    y
  });
}

// ok
Effects.promise(asyncActionCreator, "one", 2);
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
return { type: "zeroArg" };
}

function string(x: string) {
  return { type: "string", x };
}

function numberString(x: number, y: string) {
  return { type: "numberString", x, y };
}

// ok
const callEffect: Effect = Effects.call(zeroArg);

// ok
Effects.call(string, "one");

// ok
Effects.call(numberString, 1, "two");

// $ExpectError
Effects.call(string, 1);

// $ExpectError
Effects.call(string, 1);

// ok
Effects.call(string, "one", "two");

//
// Effects.promise
//
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_effects.js View on Github external
function string(x: string) {
  return { type: "string", x };
}

function numberString(x: number, y: string) {
  return { type: "numberString", x, y };
}

// ok
const callEffect: Effect = Effects.call(zeroArg);

// ok
Effects.call(string, "one");

// ok
Effects.call(numberString, 1, "two");

// $ExpectError
Effects.call(string, 1);

// $ExpectError
Effects.call(string, 1);

// ok
Effects.call(string, "one", "two");

//
// Effects.promise
//

function asyncActionCreator(x: string, y: number) {
  return Promise.resolve({