Comments (1)
Generated JS after fix:
const foo = true;
const bar = true;
const reducer = (state) => {
if (foo) {
if (bar) {
state = {
...state,
array: state.array.slice(0, state.array.length - 1)
};
}
}
else {
state = {
...state,
array: [...state.array, 123]
};
}
return state;
};
from redcr.
Related Issues (16)
- [BUG] Can't use array function as expression lambda
- [BUG] Array push of multiple elements followed by pop does not append to the array HOT 1
- [BUG] Array index assignment followed by push only assigns
- [BUG] Using the result of a mutation as a local variable results in original state being modified
- [BUG] Return statement at end of a reducer returns in undefined state
- [FEATURE] Simplify early returns
- [BUG] Multiple increments or decrements of the same field don't combine together
- [FEATURE] Lesser-used assignment operators
- [BUG] Local variables erased incorrectly when used in conditions HOT 1
- [FEATURE] Support switch statements
- [FEATURE] Support increment and decrement for numbers HOT 1
- [BUG] All array functions but the first one are lost when there's multiple calls on the same field HOT 1
- [FEATURE] Don't spread array unnecessarily when using inverse array operations
- [FEATURE] Don't reassign reducer parameter when there are no conditions
- [FEATURE] Support loops HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redcr.