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

Implement onstate and onupdate hooks #1344

Merged
merged 9 commits into from
Apr 15, 2018
Merged

Implement onstate and onupdate hooks #1344

merged 9 commits into from
Apr 15, 2018

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Apr 15, 2018

Still to do: add deprecation warnings when this.observe is called, and add this.observe to svelte-extras (which can't happen until this is released, as it will depend on the state and update events).

An unanticipated effect, which I think is actually a positive, is that we need store.on and store.fire. So apps now get a global event bus for free. (store.onchange also needs to be deprecated.)

It might also be possible to replace _bind with component.on('state'), which would be nice.

@codecov-io
Copy link

codecov-io commented Apr 15, 2018

Codecov Report

Merging #1344 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1344      +/-   ##
==========================================
+ Coverage   91.76%   91.78%   +0.02%     
==========================================
  Files         125      127       +2     
  Lines        4515     4531      +16     
  Branches     1432     1443      +11     
==========================================
+ Hits         4143     4159      +16     
  Misses        149      149              
  Partials      223      223
Impacted Files Coverage Δ
src/generators/nodes/Component.ts 96.9% <ø> (ø) ⬆️
src/validate/js/propValidators/index.ts 100% <ø> (ø) ⬆️
src/generators/dom/index.ts 95.9% <100%> (+0.14%) ⬆️
src/generators/Generator.ts 96.71% <100%> (+0.03%) ⬆️
src/validate/js/propValidators/onupdate.ts 100% <100%> (ø)
src/validate/js/propValidators/onstate.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a99ce9...3d8c768. Read the comment docs.

@Rich-Harris Rich-Harris changed the title [WIP] Implement onstate and onupdate hooks Implement onstate and onupdate hooks Apr 15, 2018
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

2 participants