status-im / pluto

https://status-im.github.io/pluto/
12 stars 3 forks source link

tighter re-frame integration #48

Closed janherich closed 6 years ago

janherich commented 6 years ago

During work on integrating newest pluto into extensions branch of status-react, I realized that tighter integration of co-effects/effects concepts (just concepts of them, no actual code dependency) from re-frame into pluto is very much needed for smooth experience in line with re-frame best practices. I'm opening the PR so the correct Pluto version can be uploaded to clojars and not sit only in my local-repo :)

Implements #8

Changes:

jeluard commented 6 years ago

It would be nice to have more details on how this simplifies things. It definitely introduces more adherence to re-frame (not necessarily bad)

Le 17 août 2018 à 18:49, Jan Herich notifications@github.com a écrit :

During work on integrating newest pluto into extensions branch of status-react, I realized that tighter integration of co-effects/effects concepts (just concepts of them, no actual code dependency) from re-frame into pluto is very much needed for smooth experience in line with re-frame best practices. I'm opening the PR so the correct Pluto version can be uploaded to clojars and not sit only in my local-repo :)

Changes:

Minor change of the AppHook protocol to work with coeffects map on input Small helper function to correctly fold effect producing functions (in this case AppHook protocol methods), this code is actually kind of duplicated (similar code exists in status-react), so it would be great to lift-it up into common status/re-frame-helpers project. You can view, comment on, or merge this pull request online at:

https://github.com/status-im/pluto/pull/48

Commit Summary

tighter re-frame integration File Changes

M src/pluto/host.cljc (4) M src/pluto/registry.cljc (79) M src/pluto/utils.cljc (14) M test/pluto/reader/hooks_test.cljc (4) M test/pluto/reader_test.cljc (4) M test/pluto/registry_test.cljc (72) A test/pluto/utils_test.cljc (18) Patch Links:

https://github.com/status-im/pluto/pull/48.patch https://github.com/status-im/pluto/pull/48.diff — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub, or mute the thread.

janherich commented 6 years ago

@jeluard please have a look at the current state of status-react/extensions branch, you will see how the tighter integration with re-frame plays out -> I think it's quite a lot neater, nowhere near the level of hackery as before required to integrate pluto registry into re-frame app (shorter event chains, less special effect, no need to manually keep local registry and re-frame toggle state in sync) + it opens door to functionalities like seamless hook-in/unhook of all extension points (hooks) for any given loaded extension.