open-index/open-npm huggingface dataset:
npm package: @rezerojs/components
Description: 基于antd的中台应用组件扩展库
Latest version: 0.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# 🧊 ReZeroJS Components
 <p>
 <a href="https://npmjs.com/@rezerojs/components"><img src="https://img.shields.io/npm/v/@rezerojs/components.svg" alt="npm package"></a> 
  <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/@rezerojs/components.svg" alt="node compatibility"></a> 
  <a href="https://github.com/rezerojs/components/actions/workflows/release.yml"><img src="https://github.com/rezerojs/components/actions/workflows/release.yml/badge.svg?branch=main" alt="build status"></a>
 </p>

基于antd的中台应用组件扩展库

## Getting Started

Install dependencies,

```bash
yarn add @rezerojs/components  # or npm i @rezerojs/components -S
```

Usage

```bash
import { IndicatorCard } from '@rezerojs/components';
```

<br />

更多使用方式, 请参见[Components](/components)下具体组件示例及 API 文档

## Feedback

[Issues](https://github.com/rezerojs/components/issues)

## LICENSE

[MIT](https://github.com/rezerojs/components/blob/main/LICENSE)
npm package: @rezeus/model
Description: Generic, ActiveRecord-like base model class.
Author: Ozan Müyesseroğlu
Latest version: 1.0.10

# Model

Generic, ActiveRecord-like base model class.

## Hooks

Hooks will be called in this order;

1. `beforeCreate` / `beforeUpdate`
1. `beforeSave`
1. `afterSave`
1. `afterCreate` / `afterUpdate`

> Note: `beforeUpdate` and `afterUpdate` hooks MUST be **manually** invoked by the extending class **if** the static method is going to be used to update the instance by it's ID (i.e. `updateById`). This class is the one which implements the data store operations (e.g. `MemoryModel` class from examples) - for other extending classes (e.g. `User`, `Post`, `Tag` classes from examples).
> Other hooks are free from this requirement.

## Recipes

### Virtual Fields

TR virtual field lar setField ve getField metodları kullanılarak yapılabilir. örneğin bir kullanıcı kaydının firstName ve lastName özellikleri varsa name virtual field i eklenebilir (many-classes örnek dosyasındaki User modelinde yapıldığı gibi) - ancak burada şöyle bir durum var; getter'ı private fields'tan (`this[PRIV].fields`) veri okumuyor, eğer okunması gereken bir durum varsa (yani getter'ın return değeri on-the-fly hesaplanmıyorsa) setField'a field name'i gönderirken '_' ile prefixle (e.g. `this.setField('_not_presisted_field_name', 13);`)

## FAQ

Below you can find error messages and their explanations.

### Cannot create a new Model instance.

Since the Model class is an "abstract" class (abstract in real OOP languages) one cannot instantiate a new Model instance using `new` keyword, e.g.;
```js
const model = new Model(); // throws this error
```

Instead of creating a new instance this way (i.e. using `new` keyword) use `.create()` static method of **a class that extends the Model class** (extending class), e.g.;
```js
// Let's say extending class name is 'User'
const user = User.create({ name: 'Jahn', surname: 'Doe' });
```

then one can set the instance's properties and then save it, like so;
```js
// ...continuing above
user.name = 'John';
await user.save();
```