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

Add signals as a container to store state #1

Merged
merged 5 commits into from
May 8, 2019
Merged

Add signals as a container to store state #1

merged 5 commits into from
May 8, 2019

Conversation

stwa
Copy link
Contributor

@stwa stwa commented May 6, 2019

  • Used as the root of state propagation.
  • Encapsulated state can be reset or updated.
  • Outputs can be connected and will be triggered on state changes.

@stwa stwa requested a review from olle May 6, 2019 09:56
Copy link
Contributor

@olle olle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the proposed nomenclature. Added an alternative wording to the docs. Hope you like it.

@olle olle assigned stwa May 6, 2019
@stwa stwa changed the title Add signals as a containers to store state Add signals as a container to store state May 7, 2019
@stwa stwa requested a review from olle May 7, 2019 13:02
@stwa
Copy link
Contributor Author

stwa commented May 7, 2019

Thanks for your feedback! I added another commit adding signals based on a functions return value. A signalFn can reference other (input) signals which are then tracked and any state changes will propagate through the signal chain.

src/signal.js Outdated Show resolved Hide resolved
src/signal.js Outdated Show resolved Hide resolved
stwa and others added 5 commits May 8, 2019 10:19
* Used as the root of state propagation.
* Encapsulated state can be reset or updated.
* Outputs can be connected and will be triggered on state changes.
* Encapsulated state from function return value.
* Tracks input signals and recomputes on any state change.
* Outputs can be connected and will be triggered on state changes.
* Releases resources to the garbage collector.
* Saves CPU time by computing less signals.
* Notifies registered watchers.
@fheft fheft merged commit d8429d4 into master May 8, 2019
@stwa stwa deleted the add-signal branch May 8, 2019 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants