npm.io
0.1.0 • Published 7 years ago

redux-nara

Licence
MIT
Version
0.1.0
Deps
0
Size
19 kB
Vulns
0
Weekly
0

Redux Nara

Features

  • Asynchronous
  • Routing
  • Key Command

Asynchronous

const getUserData: NaraAsyncWorker<MyAction, MyAppState> = async function(action: MyAction, dispatcher: Dispatch<S>) {
    const user = await api.getUser();

    dispatcher(createSuccessGetUser(user));

    const action2 = await waitAction<MyAction2>(MY_ACTION2)

    const state = getState();

};

const listener: NaraAsyncListener<MyAppState> = {
    actionType: GET_USER_DATA,
    worker: getUserData,
    options: {
        allowParallel: false,
    },
};

Key Command

const keyCommand = new NaraKeyCommand({
    onlyWithModifierKey: false,
    combinations: [
        { modifier: "Ctrl", key: "A" },
    ],
});

Keywords