Skip to content

Commit

Permalink
Merge pull request #26 from lVlyke/7.0.0
Browse files Browse the repository at this point in the history
7.0.0
  • Loading branch information
lVlyke authored Feb 22, 2022
2 parents a72ee25 + 3ef513c commit 0a73656
Show file tree
Hide file tree
Showing 43 changed files with 4,786 additions and 747 deletions.
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules/typescript/lib"
}
77 changes: 46 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,41 @@

# Lithium for Angular (@lithiumjs/angular)

[![Build Status](https://travis-ci.org/lVlyke/lithium-angular.svg?branch=master)](https://travis-ci.org/lVlyke/lithium-angular) [![Coverage](./coverage/coverage.svg)](./coverage/coverage.svg)
[![Coverage](./coverage/coverage.svg)](./coverage/coverage.svg)

A decorator-based library that allows you to fully use RxJS with Angular. Use Observables as first-class citizens in your view templates! Listen to component lifecycle events with Observables! Lithium makes your components highly reactive.
Reactive components made easy! Lithium provides utilities that enable seamless reactive state and event interactions for Angular components.

* [**Introduction**](#introduction)
* [**Installation**](#installation)
* [**Quick Start Guide**](/docs/intro-guide.md)
* [**Ivy/AoT Guide**](/docs/limitations.md)
* [**API Reference**](/docs/api-reference.md)
* [**FAQ and Other Information**](#other-information)
## Features

## [Example app](https://github.com/lVlyke/lithium-angular-example-app) - [[Live demo]](https://lvlyke.github.io/lithium-angular-example-app)
* **Reactive component state**

Lithium's `ComponentStateRef` service exposes a type-safe representation of component state properties as Subjects, allowing for observation of the component's full state automatically:
```ts
import { ComponentState, ComponentStateRef } from '@lithiumjs/angular';

@Component({
...
providers: [ComponentState.create(MyComponent)]
})
class MyComponent {

## Introduction
public value = 0;

constructor (stateRef: ComponentStateRef<MyComponent>) {
stateRef.get('value').subscribe(value => console.log("value: ", value));

this.value = 100;
}

// Output:
// value: 0
// value: 100
}
```

* **Intuitive decorators**:
* **Reactive lifecycle decorators**

Lithium is decorator-based and easy to use:
Lithium adds support for reactive component events, including decorators for component lifecycle events:
```ts
import { OnInit } from '@lithiumjs/angular';

Expand All @@ -34,25 +51,27 @@ class MyComponent {
}
}
```
* **Full reactive template binding**:

Lithium's `@StateEmitter` lets you pass Observables directly as inputs to any component and two-way bind Subjects directly to `ngModel`.
* **Works with Angular component decorators**:
* **Works with Angular component decorators**

You can use Angular's built-in component decorators with Lithium. Use an `@Input` as a Subject and listen to a `@HostListener` event as an Observable!
* **OnPush components made easy**:
* **OnPush components made easy**

With Lithium, writing more performant components using [OnPush](https://angular.io/api/core/ChangeDetectionStrategy) change detection is simple; just enable [AutoPush](/docs/intro-guide.md#autopush)!
* **Like `async`, but better**:
By tracking component state changes automatically, Lithium's [AutoPush](/docs/intro-guide.md#autopush) feature allows you to easily write more performant components using [OnPush](https://angular.io/api/core/ChangeDetectionStrategy).
* **Beyond `async`**

Lithium automatically manages subscription lifetimes just like Angular's [async pipe](https://angular.io/api/common/AsyncPipe), without its syntax overhead (and [ugly workarounds](https://coryrylan.com/blog/angular-async-data-binding-with-ng-if-and-ng-else)).
* **Integrates with other reactive decorators**:

Lithium can be used in conjunction with other reactive decorator-based libraries like [NGXS](https://github.com/ngxs/store).
## [Intro guide](/docs/intro-guide.md)

Read through the intro guide to get to know Lithium's core features.

## [Example app](https://github.com/lVlyke/lithium-angular-example-app) - [[Live demo]](https://lvlyke.github.io/lithium-angular-example-app)

The example todo list app showcases real-world usages of Lithium.

Read through the [intro guide](/docs/intro-guide.md) to get to know Lithium's core features and view the [example app](https://github.com/lVlyke/lithium-angular-example-app) to see Lithium in action with real-world use-cases. Full [API](/docs/api-reference.md) documentation is also available.
## [API reference](/docs/api-reference.md)

Lithium supports Angular's new Ivy compiler. Read [here](/docs/limitations.md) for more info.
Full API documentation is available for Lithium.

## Installation

Expand All @@ -64,23 +83,19 @@ npm install @lithiumjs/angular

## FAQ and Other information

If you are upgrading from Lithium 6.x or earlier, read through the [migration guide](/docs/lithium-7-migration-guide.md) to see how to updgrade your app to use the latest features from Lithium.

### FAQ

#### Does Lithium support Ivy (the default rendering engine for Angular 9+)?

Lithium fully supports Ivy-based applications. **Note**: Please be aware that Lithium currently uses features from the not-yet finialized Ivy API, so some features of Lithium could stop working in later versions of Angular before Lithium is updated to support them.

If you are upgrading a Lithium-enabled app to Ivy that currently uses ViewEngine, you should read the [Ivy upgrade guide](/docs/ivy-upgrade.md) for Lithium.

#### Does Lithium support the ViewEngine (pre-Ivy) applications?

Lithium 5.x.x is the last major version that supports ViewEngine-based applications. Lithium 6.x.x and above only supports Ivy-based applications.

#### Are there any known limitations with Lithium?

While Lithium integrates cleanly with Angular for the majority of cases, there are certain limitations that [are noted here](/docs/limitations.md).

### Other information

* [Ivy upgrade guide](/docs/ivy-upgrade.md) for Lithium.
* [@lithiumjs/ngx-material-theming](https://github.com/lVlyke/lithium-ngx-material-theming)
* [Migration guide](/docs/lithium-7-migration-guide.md) for migrating from Lithium 6.x and below to newer versions of Lithium.
* [@lithiumjs/ngx-material-theming](https://github.com/lVlyke/lithium-ngx-material-theming) - A theming utility for Angular Material built with Lithium.
Loading

0 comments on commit 0a73656

Please sign in to comment.