Port deepMap logic and add new features - #1
Conversation
| type arr1 = Array<obj1> | ||
|
|
||
| const $storeObj1 = deepMap<obj1>({ f: 'initial' }); | ||
| const $storeArr1 = deepMap<arr1>([{ h: true }]); |
There was a problem hiding this comment.
Strange test. Is it your type tests?
| } | ||
|
|
||
| return $deepmap | ||
| } No newline at end of file |
There was a problem hiding this comment.
I recommend copying .editorconfig which will force ending newline to files (there is old tradition to have \n at the end of the files)
|
|
||
| const $store = deepMap({ | ||
| count: 0, | ||
| type storeProps = { |
There was a problem hiding this comment.
I think most of TS developers use capitalized names for types: StoreProps
| @@ -1,9 +0,0 @@ | |||
|
|
|||
There was a problem hiding this comment.
Without index.js you exports will not be avaiable by import { … } from @nanostores/deepman``
|
You also need to fix CI |
Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
Co-authored-by: Andrey Sitnik <andrey@sitnik.ru>
| "files": [ | ||
| "dist" | ||
| ], | ||
| "exports": "./dist/deep-map/index.ts", |
There was a problem hiding this comment.
You can’t export .ts file. The content of node_modules must export only JS (Node.js’s strip types works only outside of node_modules)
| "test": "pnpm run /^test:/" | ||
| }, | ||
| "author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
| "author": "Edgar Sanchez", |
There was a problem hiding this comment.
I recommend adding email here. It is rare to get spam from github/npm but it could be very useful for some security issues, etc.
| ## Credits | ||
|
|
||
| * [Nanostores](https://github.com/nanostores/nanostores) - The original state manager. No newline at end of file | ||
| * [Nanostores](https://github.com/nanostores/nanostores) - The original state manager. |
There was a problem hiding this comment.
| * [Nanostores](https://github.com/nanostores/nanostores) - The original state manager. | |
| * [Nano Stores](https://github.com/nanostores/nanostores), the original state manager. |
|
LGTM, let’s merge it. Run |
|
What is your npm user name? |
My npm user is lifo123 |
|
I invited you to |
|
All done. i publish v0.0.1 |
Hi @ai,
Following our conversation in nanostores/nanostores#373, I've moved the deepMap logic into this new repository.
This branch includes the original logic:
I've added the new updateKey method. This allows merge new data with existing store values (e.g., for objects or arrays).
Also deepmap now accepts an array (e.g., deepMap([])) as a valid initial value. Let me know what you think!