How to use the reflex.forward function in reflex

To help you get started, we’ve selected a few reflex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github browserhtml / browserhtml / src / About / Newtab / Newtab / Wallpapers.js View on Github external
model.order.map(id =>
      thunk(
        String(id),
        Wallpaper.view,
        model.entries[id],
        forward(address, ByID(String(id)))
      )
    ))
github browserhtml / browserhtml / src / About / Newtab / Newtab / Tiles.js View on Github external
model.order.map(id =>
    thunk(
      String(id),
      Tile.view,
      model.entries[String(id)],
      forward(address, TileAction),
      isDark
    )
  )
github browserhtml / browserhtml / src / Browser / Shell.js View on Github external
(model:Model, address:Address):DOM => {
    if (!Runtime.useNativeTitlebar()) {
      return Controls.view(model.controls, forward(address, ControlsAction))
    } else {
      return html.noscript()
    }
  }
github browserhtml / browserhtml / src / Browser / Shell / Controls.js View on Github external
(model:Model, address:Address):DOM =>
  html.div({
    key: 'window-controls',
    className: 'window-controls',
    style: styleSheet.container,
    onMouseOver: forward(address, always(Over)),
    onMouseOut: forward(address, always(Out))
  }, [
    viewClose(model.close, forward(address, CloseButtonAction)),
    viewMinimize(model.minimize, forward(address, MinimizeButtonAction)),
    viewToggle(model.toggle, forward(address, ToggleButtonAction))
  ])
github browserhtml / browserhtml / src / Browser / Navigators / Navigator / Assistant / Suggestion.js View on Github external
(model:Model, address:Address):DOM => {
    switch (model.type) {
      case 'Search':
        return Search.render(model.search, forward(address, tagSearch))
      case 'History':
      default:
        return History.render(model.history, forward(address, tagHistory))
    }
  }
github mozilla / reflex / examples / counter / src / counter.js View on Github external
export var view = (model/*:Model*/, address/*:Address*/)/*:VirtualElement*/ => {
  return html.span({key: 'counter'}, [
    html.button({
      key: 'decrement',
      onClick: forward(address, Dec)
    }, ["-"]),
    html.span({
      key: 'value',
      style: counterStyle.value,
    }, [String(model.value)]),
    html.button({
      key: 'increment',
      onClick: forward(address, Inc)
    }, ["+"])
  ]);
};
github mozilla / reflex / examples / counter-set / src / counter.js View on Github external
export var view = (model/*:Model*/, address/*:Address*/)/*:VirtualElement*/ => {
  return html.span({key: 'counter'}, [
    html.button({
      key: 'decrement',
      onClick: forward(address, Dec)
    }, ["-"]),
    html.span({
      key: 'value',
      style: counterStyle.value,
    }, [String(model.value)]),
    html.button({
      key: 'increment',
      onClick: forward(address, Inc)
    }, ["+"])
  ]);
};
github mozilla / reflex / examples / gif-viewer / src / random-gif.js View on Github external
export const view = (model/*:Model*/, address/*:Address*/)/*:VirtualElement*/ =>
  html.div({key: "gif-viewer", style: style.viewer}, [
    html.h2({key: "header", style: style.header}, [model.topic]),
    html.div({key: "image", style: style.image(model.uri)}),
    html.button({key: "button", onClick: forward(address, RequestMoreAction)}, [
      "More please!"
    ])
  ])
github mozilla / reflex / examples / counter-set / src / set.js View on Github external
const viewEntry = ({id, model}/*:Entry*/, address/*:Address*/)/*:VirtualElement*/ =>
  html.div({key: id}, [
    Counter.view(model, forward(address, CounterList.by(id))),
    html.button({
      key: 'remove',
      onClick: forward(address, removeForID(id))
    }, 'x')
  ])
github browserhtml / browserhtml / src / About / Newtab / Newtab / Wallpaper.js View on Github external
(model:Model, address:Address):DOM => (
    html.div({
      className: 'wallpaper-choice',
      onClick: forward(address, always(Choose)),
      style: Style.mix(
        styleSheet.base,
        { backgroundColor: model.color }
      )
    })
  )

reflex

Functional reactive UI library

MIT
Latest version published 7 years ago

Package Health Score

48 / 100
Full package analysis