Skip to content

Commit

Permalink
allow root level functional components
Browse files Browse the repository at this point in the history
  • Loading branch information
tpresley committed Apr 30, 2024
1 parent 3c700a6 commit 901d203
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/extra/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ import { withState } from "@cycle/state"
import { makeDOMDriver } from "@cycle/dom"
import eventBusDriver from "./eventDriver"
import logDriver from "./logDriver"
import component from "../component"

export default function run(app, drivers={}, options={}) {
const { mountPoint='#root', fragments=true } = options
if (!app.isSygnalComponent) {
const name = app.name || "FUNCTIONAL_COMPONENT"
const view = app
const { model, intent, context, children, components, initialState, calculated, storeCalculatedInState, DOMSourceName, stateSourceName, debug } = app
const options = { name, view, model, intent, context, children, components, initialState, calculated, storeCalculatedInState, DOMSourceName, stateSourceName, debug }

app = component(options)
}

const wrapped = withState(app, 'STATE')

Expand Down

0 comments on commit 901d203

Please sign in to comment.