
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
need to create an object of objects properties which can be mapped into children So I need a map of
parent: {
child:{
child:{
child:{}
},
},
};
Calling {parent}_{child}/UPDATE_OBJECTS
updates parent's child property in reducer
Base object needs to consist of
{
objects: {}, //array of objects indexed by key
//singular object requires a loading boolean similar to below for multiple loading states
loading: false, //boolean for overall loading state of module
pagination: {
total: null,
currentPage: 0,
perPage: null,
},//pagination data from laravel for paginating objects from server calls
paginationKeys: [], //list of keys to paginate in the current context: populated from filter handler
currentPage: 0,
filter: (object) => {return true;},//function to filter the pagination
[{child_module_name*}] => {},
}
Example usage
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}',
});
export default vodka;
//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: {//optional
'CREATE_LINE_ASNYC': function* () {
while(true) {
const action = yield effects.take('blah');
}
},
},
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;
Reducer file
import {combineReducers} from 'redux';
import {routerReducer} from 'react-router-redux';
import vodka from './mixers';
export default combineReducers({
routing: routerReducer,
...vodka.getReducers(),
});
Saga file
import vodka from './mixers';
const sagas = [
...vodka.getSagas(),
];
export default sagas;
Routes file
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {
Route,
Switch,
withRouter,
} from 'react-router-dom';
import vodka from './mixers';
class Routes extends Component {
render() {
return (
<Switch>
<Route exact path="/" component={Login}/>
<Route exact path="/register/" component={Register}/>
<vodka.getRoutes/>
</Switch>
);
}
}
export default withRouter(connect()(Routes));
Must import vodka mixers before reducers and sagas are setup
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.