24.0.0 • Published 3 years ago

generic-jsx v24.0.0

Weekly downloads
24
License
MIT
Repository
github
Last release
3 years ago

You can find a full explanation of the ideas behind this here.

Or, try it on RunKit!

Generic JSX

This is a version of JSX for general purpose programming. Why would you want that? Well, it gives us the ability to have curried named parameters in JavaScript.

How Do I use It?

If you are using Babel, then all you should need to do is the following:

/* @jsx curry(_=>eval(_)) */
var { curry } = require("generic-jsx");

Now you'll be able make functions with named parameters that you can curry:

var fs = require("fs");
var readFileSync = ({ name, encoding }) => fs.readFileSync(name, encoding);

// ...
var readString = <readFileSync encode = "utf8"/>;

<readString name = "package.json"/>();

Or, use with data structures!

/* @jsx (curry(_=>eval(_))) */
var { curry, from } = require("generic-jsx");
var BinaryTree = require("generic-jsx/binary-tree");

// This represents 5 / ( 4 + 6)
<BinaryTree value = "/">
    <BinaryTree value = { 5 } />
    <BinaryTree value = "+">
        <BinaryTree value = { 4 } />
        <BinaryTree value = { 6 } />
    </BinaryTree>
</BinaryTree>()
23.0.0

3 years ago

22.0.0

3 years ago

21.0.0

3 years ago

24.0.0

3 years ago

20.0.0

5 years ago

19.0.0

6 years ago

18.0.0-beta.3

8 years ago

18.0.0-beta.2

8 years ago

18.0.0-beta.1

8 years ago

17.0.0

8 years ago

15.0.0

8 years ago

14.0.0

8 years ago

13.0.0

9 years ago

12.0.0

9 years ago

11.0.0

9 years ago

10.0.0

9 years ago

9.0.0

9 years ago

8.0.0

9 years ago

7.0.0

9 years ago

6.0.0

9 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago