-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from AliMD/feat/review
Review and update documents for next release
- Loading branch information
Showing
25 changed files
with
106 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
}, | ||
"cSpell.language": "en,fa", | ||
"cSpell.words": [ | ||
"alvatr", | ||
"khafan", | ||
"mastmalize", | ||
"Mihandoost", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Contributor Code of Conduct | ||
|
||
As contributors and maintainers of the AlVatr projects, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities. | ||
|
||
Communication through any of AlVatr channels (GitHub, Telegram, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. | ||
|
||
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the AlVatr projects to do the same. | ||
|
||
If any member of the community violates this code of conduct, the maintainers of the AlVatr projects may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate. | ||
|
||
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [[email protected]](mailto:[email protected]). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Contributing to AlVatr projects | ||
|
||
We would love for you to contribute to AlVatr projects and help make it even better than it is today! | ||
As a contributor, here are the guidelines we would like you to follow: | ||
|
||
## Code of Conduct | ||
|
||
Help us keep AlVatr projects open and inclusive. | ||
Please read and follow our [Code of Conduct][./CODE_OF_CONDUCT.md]. | ||
|
||
## Found a Bug? | ||
|
||
If you find a bug in the source code, you can help us by *submitting an issue* to our GitHub Repository. | ||
Even better, you can *submit a Pull Request* with a fix. | ||
|
||
## Missing a Feature? | ||
|
||
You can *request* a new feature by *submitting an issue* to our GitHub Repository. | ||
After accepted issue, if you would like to *implement* the feature, you can *submit a Pull Request*. | ||
|
||
## Commit Message Format | ||
|
||
```txt | ||
<type>(<scope>): <short summary> | ||
│ │ │ | ||
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end. | ||
│ │ | ||
│ └─⫸ Commit Scope: PackageName|Concept (optional) | ||
│ | ||
└─⫸ Commit Type: fix|feat|refactor|perf|docs|lint|chore|merge|release | ||
``` | ||
|
||
Example: `feat(signal): support signal providers` | ||
|
||
## Type | ||
|
||
Must be one of the following: | ||
|
||
- **fix**: A bug fix | ||
- **feat**: A new feature | ||
- **refactor**: A code change that neither fixes a bug nor adds a feature | ||
- **perf**: A code change that improves performance | ||
- **docs**: Documentation only changes | ||
- **lint**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, lint rules, etc) | ||
- **chore**: Other changes that don't modify `src` | ||
- **merge**: Merge branches, solve conflict, etc | ||
- **release**: Release new version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
</head> | ||
|
||
<body> | ||
<a href="./util/index.html">Util</a> | ||
<a href="./logger/index.html">Logger</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# @vatr/fetch | ||
|
||
Enhanced fetch api with timeout, promise and types. | ||
Enhanced fetch api with timeout, helper methods and types written in tiny TypeScript, ES module. | ||
|
||
## Example usage | ||
|
||
```js | ||
import { ... } from 'https://esm.run/@vatr/fetch'; | ||
import {getJson} from 'https://esm.run/@vatr/fetch'; | ||
|
||
... | ||
const productList = await getJson('/api/products', {limit: 10}, {timeout: 5_000}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,40 @@ | ||
# @vatr/signal | ||
|
||
A small and fast event system with `0` dependencies. | ||
Elegant powerful event system for handle global signals and states written in tiny TypeScript module. | ||
|
||
## Installation | ||
Every signal has own value and can be used as a advance **state management** like redux and recoil without the complexities and unnecessary facilities of those libraries. | ||
|
||
`npm install @vatr/signal` | ||
## Example usage | ||
|
||
## How to use | ||
|
||
define a signal type on `VatrSignals` and listene to event with `addSignalListener` and trigger the event with `dispatchSignal`. | ||
### Signal providers | ||
|
||
```TypeScript | ||
import { addSignalListener, dispatchSignal } from 'https://esm.run/@vatr/signal'; | ||
|
||
declare global { | ||
interface VatrSignals { | ||
readonly 'test-event': number; | ||
readonly 'my-money-change': number; | ||
} | ||
} | ||
|
||
addSignalListener('test-event', (value) => { | ||
console.log(value); | ||
}); | ||
|
||
dispatchSignal('test-event', 1); | ||
dispatchSignal('my-money-change', 10); | ||
// signal debounced with browser animation frame | ||
dispatchSignal('my-money-change', 20); | ||
``` | ||
|
||
Add multiple listene to the same event name: | ||
### Signal receivers in another file *without any cohesion with providers* | ||
|
||
```TypeScript | ||
import { addSignalListener, dispatchSignal } from 'https://esm.run/@vatr/signal'; | ||
|
||
declare global { | ||
interface VatrSignals { | ||
readonly 'test-event': void; | ||
} | ||
} | ||
|
||
addSignalListener('test-event', () => { console.log(1); }); | ||
addSignalListener('test-event', () => { console.log(2); }); | ||
addSignalListener('test-event', () => { console.log(3); }); | ||
|
||
dispatchSignal('test-event', void); | ||
``` | ||
|
||
You can remove event from all sycle with `expireSignal`: | ||
*Receive as a event:* | ||
|
||
```TypeScript | ||
import { addSignalListener, dispatchSignal, expireSignal } from 'https://esm.run/@vatr/signal'; | ||
|
||
declare global { | ||
interface VatrSignals { | ||
readonly 'test-event': void; | ||
} | ||
} | ||
|
||
addSignalListener('test-event', () => { console.log(1); }); | ||
expireSignal('test-event'); | ||
dispatchSignal('test-event', void); // this line must make a Error | ||
addSignalListener('my-money-change', (money) => { | ||
// money type is automatically set to number. | ||
console.log(money); | ||
}); | ||
``` | ||
|
||
You can test a signal dispatch before now with `hasSignalDispatchedBefore`: | ||
*Receive inside code as a promise:* | ||
|
||
```TypeScript | ||
import { addSignalListener, dispatchSignal, hasSignalDispatchedBefore } from 'https://esm.run/@vatr/signal'; | ||
|
||
declare global { | ||
interface VatrSignals { | ||
readonly 'test-event': number; | ||
} | ||
} | ||
|
||
addSignalListener('test-event', (value) => { | ||
console.log(value); | ||
}); | ||
|
||
dispatchSignal('test-event', 1); | ||
|
||
console.log(hasSignalDispatchedBefore('test-event')); | ||
const money = await waitForSignal('my-money-change', {receivePrevious: true}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.