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

🔬 Migrate to meiosis Cells #26

Open
5 tasks done
mrharpo opened this issue Jul 24, 2022 · 0 comments
Open
5 tasks done

🔬 Migrate to meiosis Cells #26

mrharpo opened this issue Jul 24, 2022 · 0 comments
Assignees
Labels
breaking 💔 Breaking changes enhancement ➕ New feature or request

Comments

@mrharpo
Copy link
Contributor

mrharpo commented Jul 24, 2022

Because

In continuing with the meiosis pattern, we need to refactor the state management to cell.state to allow for future function additions without changing the usage signature.

Old

state = stream()
app = m(App, {state: state})

// access value in component with
vnode.attrs.state().[property]()

New

cells = states.map((state) => ({ state, getState, getStream, update })
app = m(App, {cell: cells()})

// access in component with
cell.state.[property]

Done When

  • cells - stream wrapper containing:
    • state - state object passed to component
    • getState - get current state (for asyncronous components)
    • getStream - gets current state stream (for Observables)
    • update - update state with patch
@mrharpo mrharpo added enhancement ➕ New feature or request breaking 💔 Breaking changes labels Jul 24, 2022
@mrharpo mrharpo added this to the v0.4.0 Cells 🔬 milestone Jul 24, 2022
@mrharpo mrharpo self-assigned this Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking 💔 Breaking changes enhancement ➕ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants