Comments (5)
Thank you for your time!
from z.
Hi @cirokd , your sandbox at codesandbox.io is using babel which transpile your code, so z
isn't receiving your actual code but a transpiled one (which doesn't suit very well for z
).
I don't know codesandbox.io much, but I tried going on configuration files, added .babelrc
then I cleaned up the preset and then your code ran as expected 😁 , the .babelrc
file looked like this:
{
"plugins": [
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
],
"transform-object-rest-spread"
]
}
If you want to use z
with babel is possible, just select a stage which is compatible with functions with default parameters, you can see more here: https://babeljs.io/docs/en/next/presets#stage-x-experimental-presets
from z.
Thank you @leonardiwagner for your quick response!
I found this page on MDN about default parameters. Can you please tell me if I need "Basic support" only, or is "Destructured parameter with default value assignment" necessary as well? What is required for z
to work?
from z.
@cirokd actually I don't even think z
itself use default parameters at all! The requirement to use the basic support of default parameters in your case is because you are using default parameters on z and this shouldn't be transpiled, so you can go with "basic support".
That means if later you want to use object matches in z
, then will be required "destructured parameters" support once the objects matches are written using destructured parameters!
tl;dr; it will depend on what you want to write on z, not z
itself , "basic support" is fine in your case 😄
from z.
so
z
isn't receiving your actual code but a transpiled one (which doesn't suit very well forz
)
Would you accept a PR to warn about this at the top of the README? This is a very major caveat and users deserve to know up front about it.
from z.
Related Issues (20)
- Exhaustivity checking HOT 8
- does not work with typescript HOT 3
- Does not work if match value comes from a variable HOT 3
- This is awesome
- Matching Consts HOT 2
- Working with "dynamic" objects HOT 4
- Installation on Windows/without git not working due to git checkout HOT 2
- Function reflector does not handle the case of using object-based value HOT 2
- Do you need a new logo? HOT 10
- using Z with redux? HOT 2
- You're accidentally stealing a name and logo HOT 6
- Flip around order of arguments HOT 1
- Matching on types incorrectly identifies an object as a String HOT 2
- Help, with documentation. HOT 1
- Update dependencies HOT 1
- Multi-Character global condition match failure
- z is slow because it reparses function source code every time HOT 9
- Issue with example on the web page HOT 2
- Type definitions? HOT 2
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 z.