glenjamin / glenjamin/devboard

Use js-atom internally for state

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
89
Forks
12
PR merge metrics
No merged PRs in 30d

Description

And also remove & document that the react-style automerging of objects doesn't happen. This is so we can support any type of object here without messing it up.

Possibly worth providing another util on the `devboard` module to do a clean state update? `devboard.update(state, newProperties)` which would be equivalent to `Object.assign({}, state, newProperties`.

could possibly expand this on the `card` param
- `card.value` - current value (with support for `card.state` as a back-compat fallback?)
- `card.update()` - atom.swap
- `card.set()` - atom.reset
- `card.atom` - the atom itself
- `card.merge(obj | func)` react-style shallow-merge update (with support for `card.setState` as a back-compact fallback?)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.