@microphi/flux
TypeScript icon, indicating that this package has built-in type declarations

2.12.0 • Public • Published

@microphi/flux

Yet another frontend framework

Microphi is an experimental front-end framework designed to push the boundaries of modern web development. While it showcases some innovative ideas, Microphi is still in its early stages and has a long way to go before it reaches full maturity. We welcome contributions, feedback, and support from developers and enthusiasts who are interested in helping us shape and refine this framework. Together, we can drive Microphi towards a stable, efficient, and user-friendly platform. Join us on this journey and make an impact!

Install

With your favourite package manager

@microphi/flux

and install the peers packages

@microphi/di rxjs

Boostrap an application

import { bootstrap } from '@microphi/flux';
import { App } from '@microphi/flux';
import { FxRootComponent } from './fx-root.component';


@App({
  declarations: [
    FxRootComponent,
  ]
})
export class FluxApp {

  constructor() {
    console.log('app started');
  }
}

const app = bootstrap(FluxApp);

console.log('App created', app);

Let's create a counter component

import { Component } from '@microphi/flux';

@Component({
  selector: 'fx-counter',
  template: `
    <style>
      .flex-row {
        display: flex;
        flex-direction: row;
        gap: 6px;
      }

    </style>

    <div class="flex-row">
      <button (click)="increase()">+</button>
      <div>
        {{counter}}
      </div>
      <button (click)="decrease()">-</button>
    </div>
  `
})
export class FxCounterComponent {
  counter = 0;

  increase() {
    this.counter++;
  }

  decrease() {
    this.counter--;
  }
}

With the code above we are creating a web component and as such it can contain its <style> tag.

Web components ensure style encapsulation and allow transclusion seamlessly leveraging the <slot> element.

Readme

Keywords

none

Package Sidebar

Install

npm i @microphi/flux

Weekly Downloads

30

Version

2.12.0

License

MIT

Unpacked Size

51.1 kB

Total Files

48

Last publish

Collaborators

  • davidecavaliere