UNPKG

flownote

Version:

FlowNote lets developers create, organize, and reason about event-oriented applications with a simple flow-based language.

16 lines (10 loc) 686 B
import "compiler/testActions.js" as FlowNote node getClick = FlowNote.extractClickData, FlowNote.extractPlayerId node extractXY = FlowNote.getXYCoordsFromClickData node movePlayer = FlowNote.getPlayerById, FlowNote.detectPlayerMovementEvents, FlowNote.movePlayer, FlowNote.dispatchPlayerMovementEvents node displayBoundaryError = FlowNote.getPlayerById, FlowNote.sendBoundaryError node notifyRoom = FlowNote.getBroadcastMessage, FlowNote.getRoomByPlayerId, FlowNote.broadcastToRoom flow click(GET /click) = getClick$ -> extractXY#clickBranch clickBranch -Coordinates{ retry: 3 }> movePlayer*#move clickBranch -BoundaryError! displayBoundaryError clickBranch -> notifyRoom ... move