How to use the redux-loop.liftState 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_loop.js View on Github external
case "SECOND":
      return { ...state, second: true };

    default:
      // $ExpectError
      return {};
  }
};

//
// liftState
//

// ok
const lifted: [State, Effect] = L.liftState({ first: true, second: false });

//
// loop accessors
//

const state: State = { first: true, second: false };

const loopState: [State, Effect] = loop(
  { first: true, second: false },
  Effects.constant({ type: "SECOND" })
);

// ok
const model1: State = L.getModel(loopState);

// ok