Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
2
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc