lib/volt/utils/promise_extensions.rb in volt-0.9.3.pre6 vs lib/volt/utils/promise_extensions.rb in volt-0.9.3

- old
+ new

@@ -76,9 +76,14 @@ reject!(error) end end + # Forward to resolved value + def to_json(*args, &block) + self.then {|v| v.to_json(*args, &block) } + end + # Waits for the promise to resolve (assuming it is blocking on # the server) and returns the result. def sync