{"id":50946536,"url":"https://github.com/jfet97/oxjs","last_synced_at":"2026-06-17T20:38:35.466Z","repository":{"id":48001165,"uuid":"194088549","full_name":"jfet97/oxjs","owner":"jfet97","description":"Reactive JavaScript Objects and Primitives","archived":false,"fork":false,"pushed_at":"2023-01-04T01:13:51.000Z","size":194,"stargazers_count":34,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-06-17T20:38:34.212Z","etag":null,"topics":["javascript","objects","reactive","reactivity"],"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/jfet97.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-06-27T12:10:56.000Z","updated_at":"2025-12-30T20:01:39.000Z","dependencies_parsed_at":"2023-02-01T17:15:42.730Z","dependency_job_id":null,"html_url":"https://github.com/jfet97/oxjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jfet97/oxjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfet97%2Foxjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfet97%2Foxjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfet97%2Foxjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfet97%2Foxjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfet97","download_url":"https://codeload.github.com/jfet97/oxjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfet97%2Foxjs/sbom","scorecard":{"id":517414,"data":{"date":"2025-08-11","repo":{"name":"github.com/jfet97/oxjs","commit":"04a3c8a811674a0dd8f164665c5081a40a068f6e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"23 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T02:11:22.980Z","repository_id":48001165,"created_at":"2025-08-20T02:11:22.980Z","updated_at":"2025-08-20T02:11:22.980Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34465322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","objects","reactive","reactivity"],"created_at":"2026-06-17T20:38:34.625Z","updated_at":"2026-06-17T20:38:35.458Z","avatar_url":"https://github.com/jfet97.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/oxjs.svg)](https://www.npmjs.com/package/oxjs) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/jfet97/oxjs/blob/master/LICENSE) ![](https://img.shields.io/npm/dt/oxjs.svg) ![](https://img.shields.io/badge/dependencies-no%20dependencies-%231e88e5%20.svg)\n# oxjs\n\n__OxJS__ is a working in progress library written in TS that enable encapsulated reactivity, distantly inspired by VueJS reactivity system.\\\nThe library is compiled into UMD format and uses ES6 Proxies.\n\n```sh\n$ npm i -S oxjs\n```\n\n* [oxjs bases](#oxjs-bases)\n* [reactive primitives](#reactive-primitives)\n* [reactive objects](#reactive-objects)\n* [mixed observers](#mixed-observers)\n* [nested observables props](#nested-observables-props)\n* [reactive arrays](#reactive-arrays)\n* [observable observers](#observable-observers)\n* [observerByProps](#observerByProps)\n* [tips for TS devs](#tips-for-ts-devs)\n* [tests](#tests)\n* [issues](#issues)\n\n\u0026nbsp;\n\n## oxjs bases\n\n### ox.observable\u003cT extends object\\\u003e(obj: T): T\nThis method takes an object or an array and transform it into an __observable__, so its fields can be used inside an evaluator to be observed (more on evaluators later):\n```js\nconst { ox } = require('oxjs');\n\nconst $observable = ox.observable({ a: 5 });\n\n// or\n\nconst obj = { a: 5 };\nconst $observable = ox.observable(obj);\n```\n\nIn the latter case, be sure to apply changes on `$observable` from this point on or observers won't be notified:\n```js\nobj.a = newValue; // WRONG\n\n$observable.a = newValue; // NICE\n```\n\n### ox.observer\u003cT extends Evaluator\\\u003e(evaluator: T): ReturnType\u003cT\\\u003e\nThis method takes a function, called __evaluator__, and uses it to produce an __observer__.\\\nInside the evaluator, observables' fields will be used, and a value should be retured as the result of the observation process.\n\n```js\nconst { ox } = require('oxjs');\n\nconst $observable = ox.observable([1, 2, 3]);\n\nconst sumObserver = ox.observer(function evaluator() {\n    // take values from the observable\n    const _0 = $observable[0];\n    const _1 = $observable[1];\n    const _2 = $observable[2];\n\n    // return a result\n    return _0 + _1 + _2;\n});\n```\nThe `sumObserver` observer is called __reactive primitive__ because it will act as a `number`. In particular its value will be always the sum of the first three fields of the `$observable` array, also when one of them will change.\\\nThat is because those fileds are accessed into the __evaluator__, so each time one of them changes, the __evaluator__ will be called updating the `sumObserver` value:\n\n```js\nconsole.log(`${sumObserver}`); // 6\n\n// update the $observable\n$observable[0] = 5;\n\nconsole.log(`${sumObserver}`); // 10\n```\n\n## reactive primitives\n__OxJS__ let you create special reactive objects that act like a primitive:\n\n```js\nconst { ox } = require('oxjs');\n\n// it creates two observable sources from two object literals\nconst $source1 = ox.observable({\n    years: 32,\n});\n\nconst $source2 = ox.observable({\n    name: 'Mario',\n});\n\n// it creates an observer that will behave as a string\nconst stringObserver = ox.observer(() =\u003e `My name is ${$source2.name} and I'm ${$source1.years} years old`);\n\n// WARNING\ntypeof stringObserver; // object\n\n// initial evaluation\n// interpolation is used because 'stringObserver' is not a real string primitive, it behaves like a String object\n// so you need to use interpolation, or to call methods like valueOf(), toString()\nconsole.log(`${stringObserver}`); // My name is Mario and I'm 32 years old\n\n// we change the stored 'years' inside $source1\n$source1.years = 28;\n\n// the 'stringObserver' is updated\nconsole.log(`${stringObserver}`); // My name is Mario and I'm 28 years old\n\n// we change the stored 'name' inside $source2\n$source2.name = 'Luigi';\n\n// the 'stringObserver' is updated\nconsole.log(`${stringObserver}`); // My name is Luigi and I'm 28 years old\n\n// because 'stringObserver' behaves like a String object, you can use it\n// almost everywhere a string is expected and you have access to all of String.prototype methods\nstringObserver + \"!!!\"; // My name is Luigi and I'm 28 years old!!!\nstringObserver.toUpperCase(); // MY NAME IS LUIGI AND I'M 28 YEARS OLD!!!\n\n// WARNING HERE: 'stringObserver' is a String object and objects are truthy values\nif(stringObserver) { // the condition is always true\n// you have to extract its value implicitly or explicitly\nif(stringObserver != \"\") { // coercion :3\nif(stringObserver.toString()) {\n\n\n// same for number and boolean observers\nconst numberObserver = ox.observer(() =\u003e $source1.years * 10);\nconst booleanObserver = ox.observer(() =\u003e $source1.years \u003c 100);\n\n// WARNING\ntypeof numberObserver; // object\ntypeof booleanObserver; // object\n\nconsole.log(`${numberObserver}`); // 280\nconsole.log(`${booleanObserver}`); // true\n\n// we change the stored 'years' inside $source1\n$source1.years = 100;\n\nconsole.log(`${numberObserver}`); // 1000\nconsole.log(`${booleanObserver}`); // false\n\nnumberObserver.toExponential(); // 1.00e+3\n\n// WARNING HERE: 'booleanObserver' is a Boolean object and objects are truthy values\nbooleanObserver \u0026\u0026 true; // true\n// you have to extract its value\nbooleanObserver.valueOf() \u0026\u0026 true; // false\n\n// WARNING HERE: 'numberObserver' is a Number object and objects are truthy values\nif(numberObserver) { // the condition is always true\n// you have to extract its value implicitly or explicitly\nif(numberObserver != 0) { // coercion, again :)\nif(numberObserver.valueOf()) {\n```\n\n## reactive objects\nObviously we are not limited to primitives:\n\n```js\nconst { ox } = require('oxjs');\n\n// it creates two observable sources from two object literals\nconst $source1 = ox.observable({\n    years: 32,\n});\n\nconst $source2 = ox.observable({\n    name: 'Mario',\n});\n\n// it creates a reactive object\nconst reactiveObject = ox.observer(() =\u003e {\n    const years = $source1.years;\n    const name = $source2.name;\n    return {\n        years,\n        identity: {\n            name\n        }\n    }\n});\n\n\n// initial evaluation\nconsole.log(reactiveObject); // { years: 32, identity: { name: 'Mario' } }\n\n// we change the stored 'years' inside $source1\n$source1.years = 28;\n\n// the 'reactiveObject' is updated\nconsole.log(reactiveObject); // { years: 28, identity: { name: 'Mario' } }\n\n// we change the stored 'name' inside $source2\n$source2.name = 'Luigi';\n\n// the 'reactiveObject' is updated\nconsole.log(reactiveObject); // { years: 28, identity: { name: 'Luigi' } }\n```\n\n## mixed observers\nYou can mix primitives and objects observers, if you ever find a valid reason to do it:\n\n```js\nconst { ox } = require('oxjs');\n\n// it creates two observable sources from two object literals\nconst $source1 = ox.observable({\n    years: 32,\n});\n\nconst $source2 = ox.observable({\n    name: 'Mario',\n});\n\nconst reactiveMess = ox.observer(() =\u003e {\n    const years = $source1.years;\n    const name = $source2.name;\n\n    if (years \u003c 40) {\n        return `${years} years aren't enough`;\n    } else {\n        return {\n            years,\n            identity: {\n                name\n            }\n        }\n    }\n});\n\n// initial evaluation\nconsole.log(reactiveMess.valueOf()); // \"32 years aren't enough\"\n\n// update years\n$source1.years = 50;\n\nconsole.log(reactiveMess.valueOf()); // { years: 50, identity: { name: 'Mario' } }\n```\n\n## nested observables props\nObservables could have nested props:\n\n```js\nconst { ox } = require('oxjs');\n\n// it creates an observable source from an object literal with nested properties\nconst $source = ox.observable({ nested: { value1: 0, value2: 0 } });\n\n// the observer will have three reactiver props\nconst observer = ox.observer(() =\u003e ({\n    doubleValue1: $source.nested.value1 * 2,\n    value2MinusOne: $source.nested.value2 - 1,\n    nested: $source.nested,\n}));\n\n// see how encapsulated reactivity works\nsetInterval(() =\u003e {\n    $source.nested.value1++;\n    $source.nested.value2--;\n\n    console.log(\"observer.doubleValue: \", observer.doubleValue1);\n    console.log(\"observer.valueMinusOne: \", observer.value2MinusOne);\n    console.log(\"observer.nested: \", observer.nested);\n}, 1000);\n\n// after three seconds the '$source.nested' parent reference will be changed\n// but also nested observables will update accordingly\nsetTimeout(() =\u003e {\n    $source.nested = { value1: 100, value2: 200 };\n}, 3000);\n```\n## reactive arrays\n__OxJS__ is pretty good with arrays as well:\n```js\nconst { ox } = require(\"oxjs\");\n\nconst $source = ox.observable([1, 2, 3]);\n\nconst sum = ox.observer(() =\u003e $source.reduce((a, v) =\u003e {\n    return a + v;\n}, 0));\n\nconsole.log(`reduce result is: ${sum}`); // reduce result is: 6\n\n$source[3] = 4;\n\nconsole.log(`reduce result is: ${sum}`); // reduce result is: 10\n\n$source.push(10)\n\nconsole.log(`reduce result is: ${sum}`); // reduce result is: 20\n\n$source.shift()\n\nconsole.log(`reduce result is: ${sum}`); // reduce result is: 19\n```\n\n## observable observers\nObservers can be used as observables, increasing the power in your hands.\n\nExample with __objects__:\n```js\nconst {ox} = require(\"oxjs\");\n\nconst $source = ox.observable({foo: 42}); \n\n// { foo: 84 }\nconst $doubleSource = ox.observable(ox.observer(() =\u003e ({foo: $source.foo * 2})));\n\n// 83\nconst doubledFooMinusOne = ox.observer(() =\u003e $doubleSource.foo - 1);\n\n// \"doubledFooMinusOne is 83\"\nconsole.log(`doubledFooMinusOne is ${doubledFooMinusOne}`);\n\n$source.foo = 10; // $doubleSource: { foo: 20 }\n\n// \"doubledFooMinusOne is 19\"\nconsole.log(`doubledFooMinusOne is ${doubledFooMinusOne}`);\n```\nHere _$doubleSource_ is both an __observer__, because it does observe _$source.foo_ doubling its value as result, and an __observable__, used by another observer: _doubledFooMinusOne_.\n\u0026nbsp;\n\nExample with __arrays__:\n```js\nconst { ox } = require(\"oxjs\");\n\nconst $source = ox.observable([1, 2, 3]);\n\n// [2, 4, 6]\nconst $doubleMappedSource = ox.observable(ox.observer(() =\u003e $source.map(x =\u003e x * 2)));\n\n// 12\nconst sum = ox.observer(() =\u003e $doubleMappedSource.reduce((a, b) =\u003e a + b, 0));\n// 3\nconst length = ox.observer(() =\u003e $doubleMappedSource.length);\n\n// 12 - 3\nconsole.log(`${sum} - ${length}`);\n\n$source.push(4); // $source: [1, 2, 3, 4], $doubleMappedSource: [2, 4, 6, 8]\n\n// 20 - 4\nconsole.log(`${sum} - ${length}`);\n```\nHere _$doubleMappedSource_ is both an __observer__, because it does observe _$source_ doubling its values as result, and an __observable__, used by both _sum_ and _length_ observers.\n\n## observerByProps\nThe `observer` method is very powerful, because let you return an observable of any kind. But when it comes to create a _reactive object_, each time an observable source on which it depends changes, the whole observer is recreated from scratch.\\\nThis could constitute performance problems when heavy reactive objects are needed.\\\nThankfully __OxJS__ provides an API to let you specify a separate observer for each reactive property:\n\n```js\nconst { ox } = require('oxjs');\n\n// it creates an observable source from an object literal with nested properties\nconst $source = ox.observable({ nested: { value1: 0, value2: 0 } });\n\n// the observer will have three reactive props\nconst observer = ox.observerByProps([\n    {\n        key: 'doubleValue1',\n        evaluator() {\n            return $source.nested.value1 * 2;\n        }\n    },\n    {\n        key: 'value2MinusOne',\n        evaluator() {\n            return $source.nested.value2 - 1;\n        }\n    },\n    {\n        key: 'nested',\n        evaluator() {\n            return $source.nested;\n        }\n    }\n]);\n\n// see how encapsulated reactivity works\nsetInterval(() =\u003e {\n    $source.nested.value1++;\n    $source.nested.value2--;\n\n    console.log(\"observer.doubleValue: \", observer.doubleValue1);\n    console.log(\"observer.valueMinusOne: \", observer.value2MinusOne);\n    console.log(\"observer.nested: \", observer.nested);\n}, 1000);\n\n// after three seconds the '$source.nested' parent reference will be changed\n// but also nested observables will update accordingly\nsetTimeout(() =\u003e {\n    $source.nested = { value1: 100, value2: 200 };\n}, 3000);\n```\n\nCurrenlty nested props into the `observer` are not supported. You cannot use Symbols as keys.\n\n\n## tips for TS devs\n\n__OxJS__ is written in TS and it's able to mantain types for _observables_ and is able to extract types from the array of `key`-`executor` pair for _observers_ created with `observerByProps`.\\\nFor the latter though TS needs a little help.\n\n\n### observable\n```js\nconst $source1 = ox.observable({\n    years: 32,\n});\n\n// typeof $source1 is { years: number }\n```\n\n### observer created with observerByProps\nYou have to pass an array as narrow as possible (from a type point of view) to correctly exctract type info.\n```js\nconst observer = ox.observerByProps([\n    {\n        key: 'doubleValue',\n        evaluator() {\n            return $source1.years * 2;\n        }\n    },\n] as const); // \u003c- see here\n\n// typeof observer is { doubleValue: number }\n```\n\n### observer created with observer\n_Observers_ created with `observe` deserve a separate discussion.\\\nIf a _reactive object_ is generated, TS will infer the correct type:\n```js\nconst observer = ox.observer(() =\u003e ({\n    doubleValue: $source1.years * 2,\n}));\n\n// typeof observer is { doubleValue: number }\n```\n\nIf a _reactive primitive_ is generated, TS will infer the primitive type:\n```js\nconst observer = ox.observer(() =\u003e $source1.years * 2));\n\n// typeof observer is number, not Number\n```\n\n## tests\nIncoming...\n\n## issues\nCreating __reactive primitives__ was a mess for me, for Typescript and for ES6 proxies. Have you ever seen a proxy with a dynamic target?\\\nSo if something does explode, please be patient and open a polite issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfet97%2Foxjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfet97%2Foxjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfet97%2Foxjs/lists"}