@lamnhan/schemata
v0.0.24
Published
Commonly used data models.
Downloads
8
Maintainers
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
:blue_heart: Category categories
:earth_asia:
:blue_heart: Tag tags
:earth_asia:
:blue_heart: Page pages
:earth_asia:
:blue_heart: Post posts
:earth_asia:
:blue_heart: Author authors
:earth_asia:
:blue_heart: Thread threads
:earth_asia:
:blue_heart: User users
:x:
:blue_heart: Option options
:earth_asia:
:green_heart: Bundle bundles
:earth_asia:
:green_heart: Audio audios
:earth_asia:
:green_heart: Video videos
:earth_asia:
:green_heart: Product products
:earth_asia:
:heart: Order orders
:x:
:purple_heart: Notification notifications
:earth_asia:
:purple_heart: Promotion promotions
:earth_asia:
License
@lamnhan/schemata is released under the MIT license.