🗡
🗡
🗡
🗡
ConanJs
Getting Started
Github
Blog
Twitter
Search…
What is ConanJs?
Why ConanJs...
How to install/use ConanJs
About us / Github / Contact us
Demos
Demo Gallery
Conan State Demos
Conan Flow Demos
CONAN DATA
General Concepts
Conan State
Conan Flow
Creating Flows
Serialising Flows
Observing Flows
CONAN Runtime
Dependency Injection
ASAPs
Logging
API
Main Classes
Conan State Classes
Dependency Injection
ASAPS
Powered By
GitBook
Serialising Flows
Introduction
Before introducing flow serialising, is important to remind that Conan Flows are
2 dimensional data structures
.
We believe that for most use cases, when you would like to access a flow you would like to serialise it.
Let's illustrate this graphically. Let's use again the authentication example:
​
Status
State 1
State 2
State 3
State 4
State 5
notAuthenticated
​
💡
''
​
​
💡
'invalid password'
​
​
authenticating
​
​
💡
[username/TACOS]
​
​
💡
[username/password]
​
authenticated
​
​
​
​
​
💡
​
credentials
We provide you with two serialisation mechanisms, one to serialise everything, the other one to serialise a single status.
Both of them leverage Conan State to provide you the final serialised result.
toStateAll() - Serialising everything
authentication$
F
.
toStateAll
()
By serialising all, you will create a
ConanState
of
Status
​
From the example above, this would be the visual equivalent of the generate ConanState.
​
​
State 1
State 2
State 3
State 4
State 5
nextData
name
notAuthenticated
data ''
name
authenticating
data
username/ TACOS
name
notAuthenticated
data
'invalid pass..'
name
authenticating
data
username/ password
name
authenticated
data
credentials