Skip to content

Commit

Permalink
Rename main function and fix some package fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zviagintsev committed Jul 28, 2023
1 parent 35a0f3b commit d9fa442
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
10 changes: 7 additions & 3 deletions makeAutoObservable.ts → index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// https://github.com/mobxjs/mobx/discussions/2850#discussioncomment-497321

import {
$mobx, AnnotationsMap, CreateObservableOptions, isObservable, makeObservable
$mobx,
AnnotationsMap,
CreateObservableOptions,
isObservable,
makeObservable
} from 'mobx'

const annotationsSymbol = Symbol()
Expand All @@ -10,7 +14,7 @@ const objectPrototype = Object.prototype
type NoInfer<T> = [T][T extends any ? 0 : never];
type Annotations<T extends Object = Object, U extends PropertyKey = never> = AnnotationsMap<T, U>;

const makeSimpleAutoObservable = <
const makeAutoObservable = <
T extends object & { [annotationsSymbol]?: any },
AdditionalKeys extends PropertyKey = never
>(
Expand Down Expand Up @@ -58,4 +62,4 @@ const makeSimpleAutoObservable = <
return makeObservable(target, annotations, options)
}

export default makeSimpleAutoObservable
export default makeAutoObservable
20 changes: 17 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "mobx-store-inheritance",
"version": "1.0.1-0",
"version": "1.0.3",
"description": "It is like original makeAutoObservable function which allows inheritance for Mobx stores",
"main": "index.mjs",
"main": "dist/index.js",
"scripts": {
"build": "./node_modules/.bin/tsc",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"No test no candies\" && exit 1"
},
"repository": {
"type": "git",
Expand All @@ -17,6 +17,20 @@
"inheritance",
"makeAutoObservable"
],
"files": [
"src",
"dist/",
"README.md"
],
"exports": {
".": {
"default": "./dist/index.js"
}
},
"module": "./dist/index.js",
"engines": {
"node": ">=14"
},
"author": "urugator, Igor «InoY» Zviagintsev",
"license": "ISC",
"bugs": {
Expand Down

0 comments on commit d9fa442

Please # to comment.