Portal
Portal allows to create interconnections between Selos or World objects. So, that a Selo or a World object can be accessed and rendered in any other Selo or World object, even itself.
Portal does not need the new JavaScript context and iFrame for creation. Thus a stacks of portals can be easily created and manipulated as a single functional component, by passing props and sending messages through it.
Portals support recursion. All that opens quit novel approaches in human-computer interaction and general computing using Multiverses.
Recursive World
Example of recursive World object in one Selo.
Here is a World, that 10 times reflect in itself. Every client is represented with 10 Avatars (color circles), as they are also reflected with the World. So, every client interacting with a shared World in Multiverse way, being represented in 10 Yourself’s in 10 World replicas in 1 isolated Selo.
Code showing World object recursion. Here is the full source code of this example.
export default function App(props) {
const [local, setLocal] = createLocalStore({
data: {
type: "App",
nodeID: props.nodeID,
properties: {},
dynamic: [],
dynamicSelo: [],
}
}, props)
return (props.deep > 10) ? null : (
<>
Tick: {Math.round(props.selo.storeNode.tick)}
<App
nodeID={props.nodeID}
deep={props.deep + 1}
selo={props.selo}
/>
</>
)
}
Recursive Selo
Example of recursive Selo with one World object in it.
Here is a Selo, that 10 times reflect in itself. It means, that every reflected Selo initiate a new connection to the Reflector. On that every connection, the new World instance and Avatar are created. It is like, as you open 10 new Web Browser Windows or connect 10 new Devices with QR-code, and try to manipulate them all personally, simultaneously. But, here this is working on one Device, in one Browser just as one pure function.
Every client entering this collaborative World is interacting with a shared World in Multiverse way. Being represented with 100 Yourself’s (Avatars) in 10 World replicas running in 10 isolated Selos, reflecting on each other.
Code showing Selo recursion. Here is the full source code of this example.
export default function App(props) {
const [local, setLocal] = createLocalStore({
data: {
type: "App",
nodeID: props.nodeID,
properties: {},
dynamic: [],
dynamicSelo: [],
}
}, props)
return (
<>
Tick: {Math.round(props.selo.storeNode.tick)}
<Selo
seloID={props.selo.id}
nodeID={"rselo"}
component={App}
deep={props.deep}
deepCount={10}
reflectorHost={props.selo.reflectorHost}
/>
</>
)
}
There is a Demo3 world in In Krestianstvo SDK 4 Playground, that is more playful World to try out the Recursive Selo features.
Portal UI
Portal UI is the object from the Krestianstvo SDK 4 Playground. It brings a simple UI to create Portals from URL or World object names, for using inside World objects.
(Warning! The URL generated by Portal Object is not working in this Documentation site yet)
Try entering any of the provided World names:
painter | counter | simple | portal | 404 | rworld | action