Skip to content

Commit

Permalink
Merge pull request #70 from dennybiasiolli/updating-deps
Browse files Browse the repository at this point in the history
Updating deps
  • Loading branch information
dennybiasiolli authored Aug 4, 2021
2 parents 5f98abe + 87f57a9 commit 69862c2
Show file tree
Hide file tree
Showing 24 changed files with 21,349 additions and 19,021 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
React bindings for [Vuex](https://vuex.vuejs.org/)
inspired by [`react-redux`](https://github.com/reactjs/react-redux) project.

[![Build Status](https://travis-ci.org/dennybiasiolli/react-vuex.svg?branch=master)](https://travis-ci.org/dennybiasiolli/react-vuex)
[![CircleCI](https://circleci.com/gh/dennybiasiolli/react-vuex/tree/master.svg?style=svg)](https://circleci.com/gh/dennybiasiolli/react-vuex/tree/master)
[![example workflow](https://github.com/dennybiasiolli/react-vuex/actions/workflows/node.js.yml/badge.svg)](https://github.com/dennybiasiolli/react-vuex/actions/workflows/node.js.yml)
[![example workflow](https://github.com/dennybiasiolli/react-vuex/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/dennybiasiolli/react-vuex/actions/workflows/codeql-analysis.yml)
[![codecov](https://codecov.io/gh/dennybiasiolli/react-vuex/branch/master/graph/badge.svg)](https://codecov.io/gh/dennybiasiolli/react-vuex)

[![Beerpay](https://beerpay.io/dennybiasiolli/react-vuex/badge.svg)](https://beerpay.io/dennybiasiolli/react-vuex)
[![Donate with Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/~36404/donate)


Expand Down
13,683 changes: 8,233 additions & 5,450 deletions examples/simple-counter/package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions examples/simple-counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.0.1",
"private": true,
"devDependencies": {
"react-scripts": "^3.4.1"
"react-scripts": "^4.0.3"
},
"dependencies": {
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-vuex": "^0.3.1",
"vue": "^2.6.11",
"vuex": "^3.5.1"
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-vuex": "^0.3.2",
"vue": "^2.6.14",
"vuex": "^3.6.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
8 changes: 3 additions & 5 deletions examples/simple-counter/src/components/Child1.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';


const Child1 = ({
test, myCount, limitCount, isGreaterThan2, onIncrement, onIncrementAsync,
children,
Expand All @@ -14,6 +13,7 @@ const Child1 = ({

function handleIncAsync() {
if (onIncrementAsync) {
// eslint-disable-next-line no-console
onIncrementAsync().then(console.log);
}
}
Expand All @@ -29,11 +29,9 @@ const Child1 = ({
: 
{isGreaterThan2 ? 'yes' : 'no'}
{onIncrement
&& <button type="button" onClick={handleInc}>Test</button>
}
&& <button type="button" onClick={handleInc}>Test</button>}
{onIncrementAsync
&& <button type="button" onClick={handleIncAsync}>Test async</button>
}
&& <button type="button" onClick={handleIncAsync}>Test async</button>}
{children}
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions examples/simple-counter/src/containers/VisibleChild1.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import Child1 from '../components/Child1';
import mutations from '../mutations';
import actions from '../actions';

const mapStateToProps = (state, ownProps) => ({
const mapStateToProps = (state/* , ownProps */) => ({
myCount: state.count,
});
const mapDispatchToProps = (dispatch, ownProps) => ({
onIncrementAsync: val => dispatch(actions.incrementAsync(val)),
const mapDispatchToProps = (dispatch/* , ownProps */) => ({
onIncrementAsync: (val) => dispatch(actions.incrementAsync(val)),
});
const mapCommitToProps = (commit, ownProps) => ({
const mapCommitToProps = (commit/* , ownProps */) => ({
onIncrement: () => commit(mutations.increment()),
});
const mapGetterToProps = (getter, ownProps) => ({
const mapGetterToProps = (getter/* , ownProps */) => ({
isGreaterThan2: getter.countGreaterThan2,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/simple-counter/src/containers/VisibleChild2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { connect } from 'react-vuex';
import Child1 from '../components/Child1';

const mapGetterToProps2 = (getter, ownProps) => ({
const mapGetterToProps2 = (getter/* , ownProps */) => ({
isGreaterThan2: getter.countGreaterThan2,
});

Expand Down
10 changes: 5 additions & 5 deletions examples/simple-counter/src/containers/VisibleChild3.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { connect } from 'react-vuex';
import Child1 from '../components/Child1';

const mapStateToProps = (state, ownProps) => ({
const mapStateToProps = (state/* , ownProps */) => ({
limitCount: 1002,
myCount: state.mod1.count,
});
const mapDispatchToProps = (dispatch, ownProps) => ({
onIncrementAsync: val => dispatch('mod1/incrementAsync'),
const mapDispatchToProps = (dispatch/* , ownProps */) => ({
onIncrementAsync: () => dispatch('mod1/incrementAsync'),
});
const mapCommitToProps = (commit, ownProps) => ({
const mapCommitToProps = (commit/* , ownProps */) => ({
onIncrement: () => commit('mod1/increment'),
});
const mapGetterToProps = (getter, ownProps) => ({
const mapGetterToProps = (getter/* , ownProps */) => ({
isGreaterThan2: getter['mod1/countGreaterThan1002'],
});
const VisibleChild3 = connect(
Expand Down
12 changes: 9 additions & 3 deletions examples/simple-counter/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ export default new Vuex.Store({
isIncrementing: false,
},
getters: {
countGreaterThan2: (state, getters) => state.count > 2,
countGreaterThan2: (state/* , getters */) => state.count > 2,
},
mutations: {
[INCREMENT](state) {
// eslint-disable-next-line no-param-reassign
state.count += 1;
},
[INCREMENT_START](state) {
// eslint-disable-next-line no-param-reassign
state.isIncrementing = true;
},
[INCREMENT_STOP](state) {
// eslint-disable-next-line no-param-reassign
state.isIncrementing = false;
},
},
actions: {
[INCREMENT_ASYNC]({ commit, state }, payload) {
[INCREMENT_ASYNC]({ commit, state }/* , payload */) {
commit(INCREMENT_START);
return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -44,16 +47,19 @@ export default new Vuex.Store({
isIncrementing: false,
},
getters: {
countGreaterThan1002: (state, getters) => state.count > 1002,
countGreaterThan1002: (state/* , getters */) => state.count > 1002,
},
mutations: {
increment(state) {
// eslint-disable-next-line no-param-reassign
state.count += 1;
},
incrementStart(state) {
// eslint-disable-next-line no-param-reassign
state.isIncrementing = true;
},
incrementStop(state) {
// eslint-disable-next-line no-param-reassign
state.isIncrementing = false;
},
},
Expand Down
Loading

0 comments on commit 69862c2

Please sign in to comment.