You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

hyper-app

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyper-app

front-end app framework

0.0.5
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Hyper App

Easy to build front-end app.

Install

npm install --save hyper-app

Usage

Application

  • use() mount plugin.

Hyper App

  • mixin() mixin store and css module.
  • render() render component with mixin assets.
  • router() set react routes.
  • run() react-dom rendering.

Basic

import App from 'hyper-app'
import Store from './index.st'
import styles from './index.css'

const app = new App()

app.mixin(Store, styles)

app.render(({ children }, { store }) => {
  return (
    <div>Hi, this is an app.</div>
  )
})

Plugin

app.use((ctx, app) => {
  // ctx will be passed to component
  ctx.hi = 'hello guys'
})

app.use((ctx, app) => {
  // add app singleton
  app.hi = (text) => {
    ctx.halo = text
  }
})

app.hi('halo')

// component(props, ctx)
app.render(({ children }, { hi, halo }) => {
  return (
    <div>{hi}, {halo}</div>
  )
})

Keywords

node

FAQs

Package last updated on 12 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts