How to use the redux-loop.getModel 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
//
// 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
const model2: State = L.getModel(state);

// ok
const effect1: Effect = L.getEffect(loopState);

// ok
const effect2: null = L.getEffect(state);

// $ExpectError
const effect3: Effect = L.getEffect(state);

// ok
L.isLoop(loopState);

// ok
L.isLoop(state);
github flow-typed / flow-typed / definitions / npm / redux-loop_v2.2.x / flow_v0.33.x- / test_loop.js View on Github external
// 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
const model2: State = L.getModel(state);

// ok
const effect1: Effect = L.getEffect(loopState);

// ok
const effect2: null = L.getEffect(state);

// $ExpectError
const effect3: Effect = L.getEffect(state);

// ok
L.isLoop(loopState);
github ioof-holdings / redux-subspace / packages / redux-subspace-loop / src / namespaced.js View on Github external
return namespacer((state, action) => {
            const result = reducer(state, action)
            if (isLoop(result)) {
                const model = getModel(result)
                const cmd = getCmd(result)

                return loop(model, commandNamespacer(cmd))
            }
            return result
        })
    }