README
Schemata
Commonly used data models.
Install & usage
- Interface package:
npm i @lamnhan/schemata
Use the interface:
import { Post } from '@lamnhan/schemata';
const posts: Post[] = [];
const recordPosts: Record<string, Post> = {};
const post: Post = {
id: '...',
title: '...',
};
- Angular utilities:
npm i @lamnhan/ngx-schemata
Use services:
import { PostDataService } from '@lamnhan/ngx-schemata';
class Foo {
public readonly posts$ = this.postDataService.list();
public readonly post$ = this.postDataService.get('foo');
}
Use pipes:
// listing pipe
import { PostsDataPipeModule } from '@lamnhan/ngx-schemata';
// getting pipe
import { PostDataPipeModule } from '@lamnhan/ngx-schemata';
<!-- listing -->
<div *ngIf="10 | posts | async; let items">
<ul *ngIf="items.length">
<li *ngFor="let item of items">{{ item.title }}</li>
</ul>
</div>
<!-- getting -->
<div *ngIf="'foo' | post | async; let item">
<h1>{{ item.title }}</h1>
</div>
Models
categories
:earth_asia:
:blue_heart: Category
tags
:earth_asia:
:blue_heart: Tag
pages
:earth_asia:
:blue_heart: Page
posts
:earth_asia:
:blue_heart: Post
authors
:earth_asia:
:blue_heart: Author
threads
:earth_asia:
:blue_heart: Thread
users
:x:
:blue_heart: User
options
:earth_asia:
:blue_heart: Option
bundles
:earth_asia:
:green_heart: Bundle
audios
:earth_asia:
:green_heart: Audio
videos
:earth_asia:
:green_heart: Video
products
:earth_asia:
:green_heart: Product
orders
:x:
:heart: Order
notifications
:earth_asia:
:purple_heart: Notification
promotions
:earth_asia:
:purple_heart: Promotion
License
@lamnhan/schemata is released under the MIT license.