Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

hyperflux 1.2.0-rc3

Install from the command line:
Learn more about npm packages
$ npm install @etherealengine/hyperflux@1.2.0-rc3
Install via package.json:
"@etherealengine/hyperflux": "1.2.0-rc3"

About this version

HyperFlux

HyperFlux brings together various state management strategies in Ethereal Engine, in a way that makes it easy to introspect and test.

In Ethereal Engine, we define 3 different stores

The ENGINE store is, meaning actions are dispatched directly on the incoming queue, and run on the Engine timer.

createHyperStore({
  name: 'ENGINE',
  getDispatchId: () => 'engine',
  getDispatchTime: () => Engine.instance.elapsedTime
})
// IncomingActionSystem
import { applyIncomingActions } from '@etherealengine/hyperflux'
export default async function IncomingActionSystem(world) {
  return () => {
    applyIncomingActions(Engine.instance.store)
  }
}

In any case, the appropriate store must be provided when dispatching an action:

dispatchAction( WorldNetworkAction.spawnAvatar({ parameters }))

Likewise when adding or removing receptors:

addActionReceptor((a) =>
  matches(a).when(WorldNetworkAction.spawnObject.matches, (a) => recepted.push(a))
)

State objects can also be defined and retrieved from a store:

const PeerState = defineState('peers', () => {
    return [] // initial state
})

// get state
const peerState = getState(Engine.instance.store, PeerState)

All incoming, outoing, and historical actions accessible on the store.actions object.

Details


Assets

  • hyperflux-1.2.0-rc3.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0