frintjs / frint

Modular JavaScript framework for building scalable and reactive applications
https://frint.js.org/
MIT License
756 stars 37 forks source link

Ensure proper `this` context in lifecycle callbacks #383

Closed viacheslaff closed 6 years ago

viacheslaff commented 6 years ago

When initialize is defined both at the time of creation and instantiation of the apps, they didn't have proper this context so it couldn't for example access providers with this.get(...). This PR fixes the issue.

fahad19 commented 6 years ago

@viacheslaff: thanks for taking care of this! 💖

fahad19 commented 6 years ago

I am curious though how it worked in our internal project. I had screenshots in the internal PR.

codecov[bot] commented 6 years ago

Codecov Report

Merging #383 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #383      +/-   ##
==========================================
+ Coverage   97.33%   97.33%   +<.01%     
==========================================
  Files         101      101              
  Lines        3900     3908       +8     
==========================================
+ Hits         3796     3804       +8     
  Misses        104      104
Impacted Files Coverage Δ
packages/frint/src/createApp.js 100% <100%> (ø) :arrow_up:
packages/frint/src/App.spec.js 100% <100%> (ø) :arrow_up:

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 d85234b...33b2633. Read the comment docs.

viacheslaff commented 6 years ago

@fahad19 it was mostly working, but gordian app was crashing because of this issue