{"id":26973986,"url":"https://github.com/tokenchingy/panoptes","last_synced_at":"2025-07-03T15:35:48.198Z","repository":{"id":62421816,"uuid":"174188517","full_name":"TokenChingy/panoptes","owner":"TokenChingy","description":"A simple array and object watcher function for Deno. Written in TypeScript.","archived":false,"fork":false,"pushed_at":"2020-12-08T07:46:48.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T01:02:03.023Z","etag":null,"topics":["deno","javascript","proxy","typescript","watcher"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TokenChingy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-06T17:17:49.000Z","updated_at":"2025-05-06T14:21:28.000Z","dependencies_parsed_at":"2022-11-01T17:31:23.693Z","dependency_job_id":null,"html_url":"https://github.com/TokenChingy/panoptes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TokenChingy/panoptes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TokenChingy%2Fpanoptes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TokenChingy%2Fpanoptes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TokenChingy%2Fpanoptes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TokenChingy%2Fpanoptes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TokenChingy","download_url":"https://codeload.github.com/TokenChingy/panoptes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TokenChingy%2Fpanoptes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263350913,"owners_count":23453359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","javascript","proxy","typescript","watcher"],"created_at":"2025-04-03T10:19:59.173Z","updated_at":"2025-07-03T15:35:48.153Z","avatar_url":"https://github.com/TokenChingy.png","language":"TypeScript","readme":"# Panoptes\n\n\u003e A simple array and object watcher function for Deno.\n\n[![DenoLib](https://denolib.com/badge?scope=tokenchingy\u0026repo=panoptes)](https://denolib.com)\n[![Build Status](https://travis-ci.com/TokenChingy/panoptes.svg?branch=master)](https://travis-ci.com/TokenChingy/panoptes)\n\n## Table of Contents\n\n- [Panoptes](#panoptes)\n  - [Table of Contents](#table-of-contents)\n  - [Usage](#usage)\n  - [API](#api)\n    - [`watch()`](#watch)\n      - [`object: Object`](#object-object)\n      - [`callback: Function\u003cvoid\u003e`](#callback-functionvoid)\n      - [`options?: Object`](#options-object)\n        - [`callbackOnGet`](#callbackonget)\n\n## Usage\n\n```ts\nimport { watch } from 'https://deno.land/x/panoptes/mod.ts';\n```\n\nA simple example of how to use Panoptes's `watch()`.\n\n```ts\nimport { watch } from 'https://deno.land/x/panoptes/mod.ts';\n\n// Example interface for the base object.\ninterface BaseObjectStruct {\n  a: String;\n  b: {\n    c: Array\u003cString\u003e;\n  };\n  e: Number;\n}\n\n// The base object that will be watched.\nconst baseObject: BaseObjectStruct = {\n  a: 'a',\n  b: {\n    c: ['d'],\n  },\n  e: 1,\n};\n\n// The new reference object that is being watched.\nconst watchedObject: any = watch(\n  baseObject,\n  () =\u003e {\n    console.log('Something happened!');\n  },\n  {\n    callbackOnGet: false,\n  },\n);\n\n// The watch callback should fire for each execution below.\nwatchedObject.a = 'b';\nwatchedObject.b.c.push('e'); // Array methods will fire the callback multiple times.\ndelete watchedObject.e;\n\n//\u003e Something happened!\n//\u003e Something happened!\n//\u003e Something happened!\n//\u003e Something happened!\n```\n\n## API\n\n### `watch()`\n\n```ts\nwatch(object: Object, callback: Function, options?: OptionsStruct);\n```\n\n#### `object: Object`\n\nThe base object in which you would like watched.\n\n#### `callback: Function\u003cvoid\u003e`\n\nThe callback that will be fired on change. Function should not return.\n\n#### `options?: Object`\n\nThe options object passed into the `watch()` function. This is optional and implements the interface `OptionsStruct`.\n\n```ts\ninterface OptionsStruct {\n  callbackOnGet: Boolean;\n}\n```\n\n##### `callbackOnGet`\n\nSetting this to `true` will enable the watcher to fire the callback function on get operations. Not setting it will disable this feature.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenchingy%2Fpanoptes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokenchingy%2Fpanoptes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenchingy%2Fpanoptes/lists"}