volt 0.9.0.pre6 → 0.9.0.pre7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/volt/tasks/query_tasks.rb +0 -3
- data/lib/volt/models/array_model.rb +3 -1
- data/lib/volt/models/persistors/array_store.rb +0 -4
- data/lib/volt/models/persistors/model_store.rb +0 -1
- data/lib/volt/models/persistors/query/query_listener.rb +0 -4
- data/lib/volt/page/bindings/content_binding.rb +0 -1
- data/lib/volt/page/targets/binding_document/component_node.rb +0 -3
- data/lib/volt/page/tasks.rb +2 -1
- data/lib/volt/reactive/reactive_array.rb +5 -0
- data/lib/volt/spec/setup.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b1a1de6a4ca5bb3040697994dc02235caef5df1
|
4
|
+
data.tar.gz: 560933928252e51c201ffc9f0167d7a81255c415
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55024841e17f8e8f267f5728f5ed46ac81254c29c4fb3f494a840b2c337d5cbe901204bdac3396380465460b03cc2ebcaabc886d6a77b234ec50ce96d1b4a6be
|
7
|
+
data.tar.gz: 72dccab3dfa677e6b444e152ca9b3654cf48317de5a65a2ac2494b6084bc862301dbedce6d8663a803c0e46b0bb0167a5549f042724c768975877f6fc89d7c94
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.0.
|
1
|
+
0.9.0.pre7
|
@@ -62,9 +62,6 @@ class QueryTasks < Volt::Task
|
|
62
62
|
def remove_listener(collection, query)
|
63
63
|
live_query = @@live_query_pool.lookup(collection, query)
|
64
64
|
live_query.remove_channel(@channel)
|
65
|
-
#
|
66
|
-
# puts "REMOVE LIST1"
|
67
|
-
# @@live_query_pool.print
|
68
65
|
end
|
69
66
|
|
70
67
|
# Removes a channel from all associated live queries
|
@@ -83,6 +83,9 @@ module Volt
|
|
83
83
|
promise = @persistor.added(model, @array.size - 1)
|
84
84
|
if promise && promise.is_a?(Promise)
|
85
85
|
return promise.then do
|
86
|
+
# Mark the model as loaded
|
87
|
+
model.change_state_to(:loaded_state, :loaded)
|
88
|
+
|
86
89
|
# return the model
|
87
90
|
model
|
88
91
|
end.fail do |err|
|
@@ -94,7 +97,6 @@ module Volt
|
|
94
97
|
trigger_size_change!
|
95
98
|
#
|
96
99
|
# re-raise, err might not be an Error object, so we use a rejected promise to re-raise
|
97
|
-
|
98
100
|
Promise.new.reject(err)
|
99
101
|
end
|
100
102
|
end
|
@@ -69,23 +69,19 @@ module Volt
|
|
69
69
|
# Called by child models to track their listeners
|
70
70
|
def listener_added
|
71
71
|
@listener_event_counter.add
|
72
|
-
# puts "LIST ADDED: #{inspect} - #{@listener_event_counter.count} #{@model.path.inspect}"
|
73
72
|
end
|
74
73
|
|
75
74
|
# Called by child models to track their listeners
|
76
75
|
def listener_removed
|
77
76
|
@listener_event_counter.remove
|
78
|
-
# puts "LIST REMOVED: #{inspect} - #{@query.inspect} - #{@listener_event_counter.count} #{@model.path.inspect}"
|
79
77
|
end
|
80
78
|
|
81
79
|
# Called when an event is removed and we no longer want to keep in
|
82
80
|
# sync with the database. The data is kept in memory and the model's
|
83
81
|
# loaded_state is marked as "dirty" meaning it may not be in sync.
|
84
82
|
def stop_listening
|
85
|
-
# puts "Stop LIST1"
|
86
83
|
Timers.next_tick do
|
87
84
|
Computation.run_without_tracking do
|
88
|
-
# puts "STOP LIST2"
|
89
85
|
if @listener_event_counter.count == 0
|
90
86
|
if @added_to_query
|
91
87
|
@query_listener.remove_store(self)
|
@@ -35,7 +35,6 @@ module Volt
|
|
35
35
|
store.model.change_state_to(:loaded_state, :loaded)
|
36
36
|
|
37
37
|
# if Volt.server?
|
38
|
-
# puts "BACK TO DIRTY"
|
39
38
|
# store.model.change_state_to(:loaded_state, :dirty)
|
40
39
|
# end
|
41
40
|
end
|
@@ -57,8 +56,6 @@ module Volt
|
|
57
56
|
def add_store(store, &block)
|
58
57
|
@stores << store
|
59
58
|
|
60
|
-
# puts "ADD STORE FOR: #{@collection.inspect}: #{@query.inspect}"
|
61
|
-
|
62
59
|
if @listening
|
63
60
|
# We are already listening and have this model somewhere else,
|
64
61
|
# copy the data from the existing model.
|
@@ -81,7 +78,6 @@ module Volt
|
|
81
78
|
def remove_store(store)
|
82
79
|
@stores.delete(store)
|
83
80
|
|
84
|
-
# puts "REMOVE STORE: #{@collection.inspect}: #{@query.inspect} - #{@stores.size}"
|
85
81
|
# When there are no stores left, remove the query listener from
|
86
82
|
# the pool, it can get created again later.
|
87
83
|
if @stores.size == 0
|
@@ -7,7 +7,6 @@ module Volt
|
|
7
7
|
HTML_ESCAPE = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''', "\n" => "<br />\n" }
|
8
8
|
|
9
9
|
def initialize(page, target, context, binding_name, getter)
|
10
|
-
# puts "New Content Binding: #{self.inspect}"
|
11
10
|
super(page, target, context, binding_name)
|
12
11
|
|
13
12
|
# Listen for changes
|
data/lib/volt/page/tasks.rb
CHANGED
@@ -13,6 +13,11 @@ module Volt
|
|
13
13
|
|
14
14
|
# Forward any missing methods to the array
|
15
15
|
def method_missing(method_name, *args, &block)
|
16
|
+
# Long term we should probably handle all Enum methods
|
17
|
+
# directly for smarter updating. For now, just depend on size
|
18
|
+
# so updates retrigger the whole method call.
|
19
|
+
@size_dep.depend
|
20
|
+
|
16
21
|
@array.send(method_name, *args, &block)
|
17
22
|
end
|
18
23
|
|
data/lib/volt/spec/setup.rb
CHANGED