
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
react-vodka
Advanced tools
Vodka is a class to easily help build reducers and sagas for you. Vodka also manages tree like structure for objects of objects
Yarn
yarn add react-vodka
npm
npm install react-vodka --save
Example usage
// mixers.js
import Vodka from 'react-vodka';
const vodka = new Vodka({
baseUrl: 'https://api.bookstore.local',
headers: {
'Content-Type': 'application/json',
},
});
vodka.shot({
name: 'books',
endpoint: 'books/{book}',
key:'slug',
});
// Create a mapped child module of books
vodka.shot({
parents: 'books',
name: 'pages',
endpoint: 'books/{book}/{pages}/',
});
// Create a mapped child module of pages
vodka.shot({
parents: 'books.pages',
name: 'words',
endpoint: 'books/{book}/pages/{page}/words/{word}',
});
//additional example
vodka.shot({
name: 'pages',
endpoint: '/books/{book}/pages/{pages}/',
parents: 'books', //optional
key: 'slug', //optional default "id"
configs: [ //optional [prefixed automatically]
'CREATE_LINE',
'CREATE_LINE_ASYNC',
], //optional
reducers: { //optional
'CREATE_LINE' : (state, action) => {
return Object.assign({}, state, {
lines: Object.assign(state.books[action.params.book].lines, action.lines),
});
},
},
sagas: [
function* () {
while(true) {
const action = yield effects.take('CREATE_LINE');
console.log(action);
//do something with your saga
}
},
],
except: [ //optional
'store',//remove store method
],
});
// Muiltple shots example
vodka.shots([
{
name: 'books',
endpoint: 'books/{book}',
key:'slug',
},
{
name: 'pages',
parents: 'books',
endpoint: 'books/{book}/{pages}/',
},
{
name: 'words',
parents: 'books.pages',
endpoint: 'books/{book}/pages/{page}/words/{word}',
},
]);
export default vodka;
import React from 'react';
import ReactDOM from 'react-dom';
import vodka from './modules/Mixers';
import {combineReducers} from 'redux';
import {routerReducer} from 'react-router-redux';
import {reducer as form} from 'redux-form';
import {createStore} from 'react-vodka';
import {Provider} from 'react-redux';
import {BrowserRouter as Router } from 'react-router-dom';
import {syncHistoryWithStore} from 'react-router-redux';
import {createBrowserHistory} from 'history';
import Routes from './modules/Route';
import {persistStore} from 'redux-persist';
import localForage from 'localforage';
import * as preLoader from './modules/PreLoader/config';
import preloaderReducer from './modules/PreLoader/reducer';
const reducers = combineReducers({
routing: routerReducer,
form,
preloaderReducer,
...vodka.getReducers(),
});
const sagas = [
...vodka.getSagas(),
];
const browserHistory = createBrowserHistory();
const store = createStore(browserHistory, reducers, sagas, window.data);
const history = syncHistoryWithStore(browserHistory, store);
persistStore(store, {storage: localForage}, () => {
store.dispatch({
type: preLoader.SET_LOADER,
loaded: true,
});
});
ReactDOM.render(
<Provider store={store} key="provider">
<Router history={history}>
<div>
<Routes/>
</div>
</Router>
</Provider>
, document.getElementById('app'));
if (process.env.NODE_ENV !== 'production') {
window.React = React;
}
Vodka also comes with an Auth class to easily build an auth saga and reducer.
import Vodka, {Auth} from 'react-vodka';
const auth = new Auth({
baseUrl: 'http://localhost:8000/admin',
register:false,
});
const vodka = new Vodka({
baseUrl: 'http://localhost:8000/admin',
auth: auth,
});
export default vodka;
git clone
yarn && yarn build && npm link
FAQs
React CRUD system
The npm package react-vodka receives a total of 9 weekly downloads. As such, react-vodka popularity was classified as not popular.
We found that react-vodka demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.