merisbahti / klyva

A state management library that follows the React component model
MIT License
55 stars 4 forks source link

Clean up atom constructor #40

Closed krawaller closed 3 years ago

krawaller commented 3 years ago

Here's a take on cleaning up the structure and return typings in atom.ts:

No behaviour change, this is all about tidying up types and making the code easier to reason about.

codesandbox-ci[bot] commented 3 years ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9411f25d3cd8312ba0256435c6a44b2887eeae89:

Sandbox Source
React Configuration
React Typescript Configuration
krawaller commented 3 years ago

@merisbahti I also see this as a preparatory step for the dev tools support; by having clearer atom construction code it will be easier to add eventual new parameters ("store" id, atom description, etc) needed for dev tools.