Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make everything a slice #616

Open
cowboyd opened this issue Oct 14, 2020 · 0 comments
Open

Make everything a slice #616

cowboyd opened this issue Oct 14, 2020 · 0 comments
Assignees
Labels
architecture @bigtest/atom issues related to the `@bigtest/atom` package chore

Comments

@cowboyd
Copy link
Member

cowboyd commented Oct 14, 2020

depends on #559

Right now we have a lot of duplication in the Atom code and the Slice code. because in addition to housing the value, the atom can be sliced and diced directly. Instead, let's refactor atom to be just a simple referefence to a subscription of values with set() method that allows you to publish a new value.

Then, Slice can just take an atom in its constructor, and everything in the app becomes a slice. We could even have a createAtom function, return a (root) slice:

declare function createAtom<S>(initial: S): Slice<S>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture @bigtest/atom issues related to the `@bigtest/atom` package chore
Projects
None yet
Development

No branches or pull requests

2 participants