Streams

Finally, let's work some FRP awesomeness into our components.Remember that streams should be cold, meaning that they only emit values when subscribe() is called.Rx Observables are first-class citizens in Zorium

Server-side rendering

Zorium is built from the ground-up to support server-side rendering.All application code should simply work in a plain Node.js environment, without any special modification.Network requests can run seamlessly server-side to generate a complete DOM (with caching).For a more in-depth example, check out the Zorium Seed project.

Parameters

Lifecycle Hooks

afterMount() called with element when inserted into the DOM

beforeUnmount() called before the element is removed from the DOM

classBindComponent
afterMount: ($el) -># called after $el has been inserted into the DOM# $el is the rendered DOM node
beforeUnmount: -># called before the element is removed from the DOM
render: ->
z 'div',
z 'span', 'Hello World'
z 'span', 'Goodbye'

z.renderToString()

Render a virtual-dom tree to a stringCompletes after all states have settled to a value, or the request times out.The default timeout is 250ms.Errors may contain the last successful rendering (in case of timeout or error) on error.html

Note: Server-Side rendering is meant to stay separate from the API layer and only pre-render the DOM.i.e. keep the client-server model you would use for a single-page application