Class: Ovto::PureComponent
Defined Under Namespace
Classes: StateIsNotAvailable
Instance Method Summary
collapse
Methods inherited from Component
hash_to_js_obj, #render
Constructor Details
#initialize(wired_actions) ⇒ PureComponent
5
6
7
8
9
|
# File 'lib/ovto/pure_component.rb', line 5
def initialize(wired_actions)
super
@prev_props = nil
@cache = nil
end
|
Instance Method Details
#do_render(args, state) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/ovto/pure_component.rb', line 11
def do_render(args, state)
return @cache if args == @prev_props
@prev_props = args
@cache = super
end
|
#state ⇒ Object
18
19
20
|
# File 'lib/ovto/pure_component.rb', line 18
def state
raise StateIsNotAvailable, "Cannot use state in PureComponent"
end
|