Commit Graph

374 Commits

Author SHA1 Message Date
Daniel Compton 3e8f1e1dfa Log warning when non reactive parameters are passed to dynamic subscriptions
Closes #115
2015-10-16 14:47:15 +13:00
Daniel Compton 518ff995dc Remove extra level of indirection when creating dynamic subscription
Instead of creating a RAtom and resetting into it on a seperate side
chain of our dependency graph, we can instead return a reaction which is
the result of @@sub, achieving the same goals but with less code and
complexity.
2015-10-16 14:47:15 +13:00
Daniel Compton 12b71b85e5 Update version to 0.5.0-SNAPSHOT 2015-10-16 14:47:15 +13:00
Daniel Compton 7e492930e3 Add dynamic subscriptions to re-frame
Dynamic subscriptions allow the user to specify subscriptions that
depend on Ratoms/Reactions and will be rerun when they change. Users
will subscribe with v and a vector of dynamic values. The dynamic values
are dereffed and passed to the handler-fn. Dynamic subscriptions need to
pass a fn which takes app-db, v, and the dereffed dynamic values.

Every time a dynamic value changes, handler-fn will be rerun. This is in
contrast to standard subscriptions where handler-fn will only be run
once, although the reaction that it produces will change over time.

A concrete example of the need for this is:
1. You want to subscribe to a query on a remote server which will return
a Reaction which changes in response to server changes.
2. You want this subscription to be able to be rerun when you change one
of the query parameters.

In the current system, all views need to be aware of the possibility of
changing parameters and provide them in their subscriptions.

Example usage code:

(register-sub
  :todo-dynamic
  (fn todo-dynamic [_ _ [active-list]]
    (let [q (q/get-query active-list)]
      q)))

(register-sub
  :todos
  (fn todos [db _]
    (let [active-list (subscribe [:active-list])
          todos       (subscribe [:todo-dynamic] [active-list])]
      (make-reaction (fn todo-vals [] (update @todos :result #(vals (:list %))))))))
2015-10-16 14:46:54 +13:00
Daniel Compton bbc6bc4abe Add section on open source re-frame applications
Fixes #122
2015-10-13 08:27:46 +13:00
Daniel Compton af0190d76d Merge branch 'master' into develop
Update develop with the latest commits made on master.
This shouldn't be necessary in the future as PR' will go to develop first.
2015-09-28 10:16:47 +13:00
Daniel Compton 00eda37305 Bump to 0.4.2-SNAPSHOT 2015-09-28 10:04:40 +13:00
Daniel Compton e803659a56 Add clarification around usage of Github issues
Support questions need to go to other places.
2015-09-21 14:49:21 +12:00
Daniel Compton 93335b0ad4 Add clarification around usage of Github issues
Support questions need to go to other places.
2015-09-21 14:47:53 +12:00
Daniel Compton 7806a6499b Add CONTRIBUTING.md guidelines 2015-09-21 14:42:48 +12:00
Colin Yates 27835cf710 Updated README.md
Added an example of a subscription based on setup config for form-2 components.
2015-09-12 22:33:23 +12:00
Daniel Compton 2720b27e4c Merge pull request #100 from thenonameguy/patch-2
Use if-not instead of (if (not))
2015-09-12 20:27:35 +12:00
Daniel Compton 67c97ae668 Merge pull request #114 from Day8/revert-113-patch-2
Revert "typo in comment"
2015-09-07 11:43:47 +12:00
Daniel Compton 8977fa2351 Revert "typo in comment" 2015-09-07 11:43:30 +12:00
Daniel Compton c3a19788a2 Merge pull request #113 from led/patch-2
typo in comment
2015-09-07 09:53:51 +12:00
led 5a78f6b532 typo in comment 2015-09-06 15:59:58 +01:00
Mike Thompson ebe19bda29 Merge pull request #98 from Day8/contributing
Add CONTRIBUTING.md guidelines
2015-08-12 09:23:52 +10:00
Daniel Compton ce219635a5 Merge pull request #97 from Day8/deploy-repositories
Add deploy repositories for clojars
2015-07-27 20:05:59 +12:00
Daniel Compton c3f0b9e68d Add deploy repositories for clojars 2015-07-27 20:05:26 +12:00
Daniel Compton 9033d0c9c3 Merge pull request #99 from Day8/travis
Remove addons, not necessary
2015-07-27 20:03:51 +12:00
Daniel Compton 79b33efcd4 Remove addons, not necessary 2015-07-27 19:57:23 +12:00
Daniel Compton bdc792d3d4 Use new apt-sources feature 2015-07-27 19:41:27 +12:00
Daniel Compton d83778f231 Update Travis to use new container infrastructure 2015-07-27 19:34:25 +12:00
Daniel Compton 419ac4b5e0 Add CONTRIBUTING.md guidelines 2015-07-27 19:28:52 +12:00
Daniel Compton 915ad9a351 Merge branch 'master' into develop
Conflicts:
	README.md
	examples/todomvc/src/todomvc/db.cljs
2015-07-27 16:51:22 +12:00
Szabó Krisztián e0c816859f Use if-not instead of (if (not)) 2015-07-26 19:57:17 +02:00
Daniel Compton b566c08f40 Merge pull request #84 from ducky427/patch-1
Minor code cleanup
2015-07-25 07:44:22 +12:00
Daniel Compton fa05388e04 Merge pull request #90 from thenonameguy/remove_whitespace_problems
Remove unnecessary whitespace, fix EOF newlines
2015-07-25 07:42:42 +12:00
Daniel Compton ccdd662ab2 Merge pull request #89 from thenonameguy/patch-1
Fix spelling of 'weird' in comments
2015-07-25 07:42:12 +12:00
Krisztian Szabo 312eae223f Remove unnecessary whitespace from code 2015-07-24 16:39:28 +02:00
Krisztian Szabo 44e0b7383c Remove unnecessary whitespace from tests 2015-07-24 16:39:04 +02:00
Szabó Krisztián 72b2889f94 Fix spelling of 'weird'
https://en.wiktionary.org/wiki/wierd
2015-07-24 15:43:40 +02:00
Daniel Compton dd0471ee29 Merge pull request #85 from lustrousgorilla/patch-1
Correct typo.
2015-07-18 11:18:27 +12:00
Gabriel Arrillaga 695cf6dcbf Correct typo. 2015-07-17 16:28:11 -06:00
Stuart Mitchell f1cb3ad66c updated CHANGES.md 2015-07-17 14:43:22 +12:00
Stuart Mitchell 62251dfe2b fixed issue with log groupings 2015-07-17 14:16:56 +12:00
Stuart Mitchell 8caee1115b fixes bug introduced by 8af8c6840f 2015-07-17 11:51:34 +12:00
Ducky fc9da0d13a Minor code cleanup 2015-07-16 17:25:54 +01:00
mike-thompson-day8 699d6232cd Improve comments in todomvc example 2015-07-15 16:23:10 +10:00
mike-thompson-day8 328c3e0dca More readme tweaks 2015-07-15 16:22:37 +10:00
mike-thompson-day8 d97e994d9f Remove some paragraphs from the README 2015-07-15 13:51:47 +10:00
mike-thompson-day8 2ba8914d8d Further cleanup around fix for #78 2015-07-14 00:54:28 +10:00
mike-thompson-day8 cd46a22c8e Merge branch 'master' into develop 2015-07-14 00:28:55 +10:00
mike-thompson-day8 a5be3aaf3b Fix #78 Add Schema to todomvc example 2015-07-14 00:27:35 +10:00
Daniel Compton 2f87ffe810 Merge pull request #80 from moohdyy/patch-1
Correct citation error
2015-07-14 01:05:31 +12:00
moohdyy ef977fb12f Correct citation error
Richard Dawkins -> Steve Grand
2015-07-13 13:45:59 +02:00
Mike Thompson 8af8c6840f Merge pull request #76 from estsauver/cleanup-middleware-compose
Simplify implementation of Middleware Compose
2015-07-11 18:40:42 +10:00
Earl St Sauver 9326a411e7 Simplify implementation of Middleware Compose
The implementation of middleware compose is duplicating behavior already
in compose.

`(apply comp [])` returns identity.
2015-07-11 11:52:23 +07:00
Mike Thompson 02c12bf6d6 Merge pull request #75 from estsauver/example-cleanup
Remove unneccessary atom refer
2015-07-10 17:10:46 +10:00
Mike Thompson eb9f8f44f7 Merge pull request #74 from smahood/master
Replace dispatch with dispatch-sync for issue #39
2015-07-10 17:10:29 +10:00