You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data:matestack_component(:post_component, post:@post)# add this line
1126
+
data: post_component(post:@post)
1125
1127
})
1126
1128
render json: {
1127
1129
message:'Post was successfully created.'
@@ -1144,7 +1146,7 @@ end
1144
1146
1145
1147
Again: you probably don't realize any difference on the UI, but now ONLY the updated post will be rendered on the server and pushed to the `cable` component mounted in the browser.
1146
1148
1147
-
The `cable` component is configured to `updated` the component pushed from the server on the `cable__liked_post` event. The `cable` component then reads the ID of the root element of the pushed component, looks for that ID within it's body and updates this element with the pushed component.
1149
+
The `cable` component is configured to `update` the component pushed from the server on the `cable__liked_post` event. The `cable` component then reads the ID of the root element of the pushed component, looks for that ID within it's body and updates this element with the pushed component.
1148
1150
1149
1151
Now, we're rerendering the list and its elements completely with the `cable` component. As described, this is an ALTERNATIVE approach to the introduced `async` component approach. The `cable` component requires a bit more implementation and brain power but makes our reactivity more scalable. Use the `cable` component wherever you think `async` would be too slow at some point!
1150
1152
@@ -1576,6 +1578,8 @@ And now we do something, what's not possible in Twitter: Editing. Tweets. Inline
0 commit comments