Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proxy#137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Akramjon2658 wants to merge3 commits intojavascript-tutorial:master
base:master
Choose a base branch
Loading
fromAkramjon2658:proxy_begin
Open

Proxy#137

Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
9 changes: 5 additions & 4 deletions1-js/99-js-misc/01-proxy/article.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
# Proxy and Reflect

A `Proxy` object wraps another object and intercepts operations, like reading/writing properties and others, optionally handling them on its own, or transparently allowing the object to handle them.
`Proxy` obyekti boshqa obyektni o'rab turadi va xususiyatlarni o'qish/yozish va boshqa operatsiyalarni tutib qolib, ularni boshqarish imkonini beradi. Standart holatda (default) obyekta operatsiyalarni shaffof boshqarishga imkon beradi.

Proxylar ko'p kutubxonalar va ayrim brauzer frameworklarida ishlatilgan. Ushbu bobda biz ko'plab amaliy dasturlarni ko'rib chiqamiz.

Proxies are used in many libraries and some browser frameworks. We'll see many practical applications in this article.

## Proxy

The syntax:
Sintaksis:

```js
let proxy = new Proxy(target, handler)
```

- `target` --is an object to wrap, can be anything, including functions.
- `target` --o'rab olish uchun obyekt, har narsa bo'lishi mumkin, funksiya ham.
- `handler` -- proxy configuration: an object with "traps", methods that intercept operations. - e.g. `get` trap for reading a property of `target`, `set` trap for writing a property into `target`, and so on.

For operations on `proxy`, if there's a corresponding trap in `handler`, then it runs, and the proxy has a chance to handle it, otherwise the operation is performed on `target`.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp