0.1.12 • Published 1 year ago

@web-companions/fc v0.1.12

Weekly downloads
26
License
MIT
Repository
github
Last release
1 year ago

Functional Components. A wrapper for creating Web components like React.js components with hooks

This library is just an experiment inspired by React.js and TNG-Hooks. If you are looking for a simple and universal library for creating UI elements please see on @web-companions/gfc and its preset @web-companions/lit


Installation

npm install @web-companions/fc --save

Usage

It's up to you, but I suggest using this library with babel-plugin-transform-jsx-to-tt and lit-html or another library to rendering templates to DOM.

index.jsx

/**
 * ROOT element
 */
import { EG, NG, useEffect, useState } from '@web-companions/fc';
import { render } from 'lit-html';

EG({ render })(() => {
  const [state, setState] = useState<number>(1);

  useEffect(() => {
    setTimeout(() => {
      setState(10);
    }, 3000);
  }, []);

  return <div>{state}</div>;
})('demo-fc');

More examples are here.


0.1.11

1 year ago

0.1.12

1 year ago

0.1.10

2 years ago

0.1.10-alpha.0

2 years ago

0.1.9-develop.0

2 years ago

0.1.9-develop.1

2 years ago

0.1.9

2 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.5-develop.1

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.5-develop.0

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.1.0-test-tng.9

4 years ago

0.1.0-test-tng.8

4 years ago

0.1.0-test-tng.7

4 years ago

0.1.0-test-tng.6

4 years ago

0.1.0-test-tng.5

4 years ago

0.1.0-test-tng.4

4 years ago

0.1.0-test-tng.3

5 years ago

0.1.0-test-tng.2

5 years ago

0.1.0-test-tng.1

5 years ago

0.1.0-test-tng.0

5 years ago

0.1.0-test-u.5

5 years ago

0.1.0-test-u.3

5 years ago

0.1.0-test-u.4

5 years ago

0.1.0-test-u.1

5 years ago

0.1.0-test-u.2

5 years ago

0.1.0-test-u.0

5 years ago

0.1.0-develop.2

5 years ago

0.1.0-develop.1

5 years ago

0.1.0-develop.0

5 years ago