redux-nara
v0.1.0
Published
## Features
Downloads
14
Readme
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" },
],
});