anharu2394 / rubelm

[under development] A Opal library for building web applications
10 stars 1 forks source link

Define state and initial state #4

Closed anharu2394 closed 5 years ago

anharu2394 commented 5 years ago

ステートを定義して、使うことができる。

state = Struct.new(:count)
initial_state = state.new(0)
view = component do |state, _actions|
  div({}, state.count)
end