volt 0.7.12 → 0.7.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +1 -1
- data/VERSION +1 -1
- data/app/volt/tasks/live_query/live_query_pool.rb +1 -1
- data/docs/volt-logo.jpg +0 -0
- data/lib/volt/models/model.rb +2 -0
- data/lib/volt/models/persistors/model_store.rb +4 -2
- data/lib/volt/reactive/event_chain.rb +1 -1
- data/lib/volt/reactive/events.rb +1 -0
- data/lib/volt/reactive/reactive_array.rb +1 -1
- data/lib/volt/reactive/reactive_value.rb +5 -1
- data/lib/volt/utils/generic_pool.rb +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0050f5ac129588d9ec24b02a9b8aaa19ff2003
|
4
|
+
data.tar.gz: 05b63b91265dc30256fa8db98114542aad699987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 354f2e09f8e0827a693171b73fbfcd08e66dece3725a788047d40e72a71890f046030e0bf8240f6270755c7f36b8e668fbf257d20346849feb93c19147b0923f
|
7
|
+
data.tar.gz: a33eb668641e8a7d2c6ab1176f025719486e4dc3fd9c1d4c26dcd4ff8e1c1e3e7c837178c7f1d2f8ccf651e84542102668d1e6b89f7be27d0615e07b9c3a7b7d
|
data/Readme.md
CHANGED
@@ -14,7 +14,7 @@ Instead of syncing data between the client and server via HTTP, volt uses a pers
|
|
14
14
|
|
15
15
|
Pages HTML is written in a handlebars like template language. Volt uses data flow/reactive programming to automatically and intelligently propagate changes to the DOM (or anything other code wanting to know when a value updates) When something in the DOM changes, Volt intelligently updates only the nodes that need to be changed.
|
16
16
|
|
17
|
-
See a quick demo video here: [
|
17
|
+
See a quick demo video here: [https://www.youtube.com/watch?v=6ZIvs0oKnYs](https://www.youtube.com/watch?v=6ZIvs0oKnYs) and [https://www.youtube.com/watch?v=c478sMlhx1o](https://www.youtube.com/watch?v=c478sMlhx1o)
|
18
18
|
|
19
19
|
|
20
20
|
## Goals
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.13
|
@@ -22,7 +22,7 @@ class LiveQueryPool < GenericPool
|
|
22
22
|
private
|
23
23
|
# Creates the live query if it doesn't exist, and stores it so it
|
24
24
|
# can be found later.
|
25
|
-
def create(collection, query)
|
25
|
+
def create(collection, query={})
|
26
26
|
# If not already setup, create a new one for this collection/query
|
27
27
|
return LiveQuery.new(self, @data_store, collection, query)
|
28
28
|
end
|
data/docs/volt-logo.jpg
ADDED
Binary file
|
data/lib/volt/models/model.rb
CHANGED
@@ -275,6 +275,8 @@ class Model
|
|
275
275
|
# Add to the collection
|
276
276
|
new_model = save_to.append(self.attributes)
|
277
277
|
|
278
|
+
# Set the buffer's id to track the main model's id
|
279
|
+
self.attributes[:_id] = new_model._id
|
278
280
|
options[:save_to] = new_model
|
279
281
|
|
280
282
|
# TODO: return a promise that resolves if the append works
|
@@ -53,14 +53,16 @@ module Persistors
|
|
53
53
|
|
54
54
|
# Called when the model changes
|
55
55
|
def changed(attribute_name=nil)
|
56
|
+
path = @model.path
|
57
|
+
|
56
58
|
promise = Promise.new
|
57
59
|
|
58
60
|
ensure_setup
|
59
61
|
|
60
|
-
path_size =
|
62
|
+
path_size = path.size
|
61
63
|
if !(defined?($loading_models) && $loading_models) && @tasks && path_size > 0 && !@model.nil?
|
62
64
|
if path_size > 3 && (parent = @model.parent) && source = parent.parent
|
63
|
-
@model.attributes[:"#{
|
65
|
+
@model.attributes[:"#{path[-4].singularize}_id"] = source._id
|
64
66
|
end
|
65
67
|
|
66
68
|
@tasks.call('StoreTasks', 'save', collection, self_attributes) do |errors|
|
@@ -47,7 +47,7 @@ class EventChain
|
|
47
47
|
# Register an event listener that chains from object to self
|
48
48
|
def setup_listener(event, chain_listener)
|
49
49
|
return chain_listener.object.on(event, @main_object) do |filter, *args|
|
50
|
-
if callback = chain_listener.callback
|
50
|
+
if (callback = chain_listener.callback)
|
51
51
|
callback.call(event, filter, *args)
|
52
52
|
else
|
53
53
|
# Trigger on this value, when it happens on the parent
|
data/lib/volt/reactive/events.rb
CHANGED
@@ -214,7 +214,7 @@ class ReactiveManager
|
|
214
214
|
end
|
215
215
|
|
216
216
|
def inspect
|
217
|
-
"@<#{self.class.to_s}:#{
|
217
|
+
"@<#{self.class.to_s}:#{object_id} #{cur.inspect}>"
|
218
218
|
end
|
219
219
|
|
220
220
|
def reactive_object_id
|
@@ -266,6 +266,7 @@ class ReactiveManager
|
|
266
266
|
|
267
267
|
|
268
268
|
def update_followers
|
269
|
+
return if @setting_up
|
269
270
|
if has_listeners?
|
270
271
|
current_obj = cur(false, true)
|
271
272
|
should_attach = current_obj.respond_to?(:on)
|
@@ -274,7 +275,9 @@ class ReactiveManager
|
|
274
275
|
if !@cur_cache || current_obj.object_id != @cur_cache.object_id
|
275
276
|
remove_followers
|
276
277
|
|
278
|
+
@setting_up = true
|
277
279
|
@cur_cache_chain_listener = self.event_chain.add_object(current_obj)
|
280
|
+
@setting_up = nil
|
278
281
|
end
|
279
282
|
else
|
280
283
|
remove_followers
|
@@ -283,6 +286,7 @@ class ReactiveManager
|
|
283
286
|
# Store current if we have listeners
|
284
287
|
@cur_cache = current_obj
|
285
288
|
end
|
289
|
+
|
286
290
|
end
|
287
291
|
|
288
292
|
def remove_followers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -352,6 +352,7 @@ files:
|
|
352
352
|
- bin/volt
|
353
353
|
- docs/GETTING_STARTED.md
|
354
354
|
- docs/WHY.md
|
355
|
+
- docs/volt-logo.jpg
|
355
356
|
- lib/volt.rb
|
356
357
|
- lib/volt/assets/test.rb
|
357
358
|
- lib/volt/benchmark/benchmark.rb
|