0.1.10 • Published 11 months ago

@web-companions/fc v0.1.10

Weekly downloads
26
License
MIT
Repository
github
Last release
11 months 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.10

11 months ago

0.1.10-alpha.0

11 months ago

0.1.9-develop.0

1 year ago

0.1.9-develop.1

1 year ago

0.1.9

11 months ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.5-develop.1

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.5-develop.0

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.1.0-test-tng.9

3 years ago

0.1.0-test-tng.8

3 years ago

0.1.0-test-tng.7

3 years ago

0.1.0-test-tng.6

3 years ago

0.1.0-test-tng.5

3 years ago

0.1.0-test-tng.4

3 years ago

0.1.0-test-tng.3

4 years ago

0.1.0-test-tng.2

4 years ago

0.1.0-test-tng.1

4 years ago

0.1.0-test-tng.0

4 years ago

0.1.0-test-u.5

4 years ago

0.1.0-test-u.3

4 years ago

0.1.0-test-u.4

4 years ago

0.1.0-test-u.1

4 years ago

0.1.0-test-u.2

4 years ago

0.1.0-test-u.0

4 years ago

0.1.0-develop.2

4 years ago

0.1.0-develop.1

4 years ago

0.1.0-develop.0

4 years ago