npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hake

v4.0.0

Published

> The minimal configurations for a Redux based React App powered by TypeScript

Downloads

25

Readme

hake

The minimal configurations for a Redux based React App powered by TypeScript

This package include the following packages, the main idea is reuse these configurations in multiple projects.

  "dependencies": {
    "@types/react": "^15.0.9",
    "@types/react-dom": "^0.14.23",
    "@types/react-redux": "^4.4.36",
    "@types/react-router": "^3.0.3",
    "@types/react-router-redux": "^4.0.40",
    "@types/redux-immutable": "^3.0.33",
    "immutable": "^3.8.1",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-redux": "^5.0.2",
    "react-router": "^3.0.2",
    "react-router-redux": "^4.0.8",
    "redux": "^3.6.0",
    "redux-immutable": "^3.1.0",
    "hake-redux": "^0.0.5"
  }

Table of Contents

Install


npm i hake -S 

# or

yarn add hake

Get started in seconds with https://github.com/wmonk/create-react-app-typescript

  • Create your awesome app using create-react-app my-app --scripts-version=react-scripts-ts
  • Start up a local server

cd my-app

yarn start

Now you have a react app running at http://localhost:3000/

  • Add hake support
yarn add hake

modify index.tsx to:

--- a/my-app/src/index.tsx
+++ b/my-app/src/index.tsx
@@ -1,9 +1,16 @@
-import * as React from 'react';
-import * as ReactDOM from 'react-dom';
 import App from './App';
 import './index.css';

-ReactDOM.render(
-  <App />,
-  document.getElementById('root') as HTMLElement
-);
+import hake from 'hake'
+
+// your routes configurations or
+// a function please read the source code get more informations
+
+const routes = [{
+  path: '/',
+  component: App
+}]
+
+const app = hake({ routes })
+
+app.start()

Thats it, now you have a running react app but with redux react-router supported.

Usage


import hake from 'hake'

// your routes configurations or 
// a function please read the source code get more informations

const routes = [{
    path: '/',
    component: App
}]

const app = hake({routes})

app.start()

For more informations please read the source file take a look.

// all options list here

export interface options {
    /**
     * Can be a function with store parameter or a RouteConfig route
     *
     * @type {(Routes | RouteConfig)}
     * @memberOf options
     */
    routes: Routes | RouteConfig;
    /**
     * Can be Map or any immutable type
     *
     *
     * @memberOf options
     */
    initialState?: any;
    /**
     * Can be an object within {key:Function}
     *
     *
     * @memberOf options
     */
    asyncReducers?: {};
    history?: History;
    rootReducer?: Function;
    /**
     * custom render,you can add other Provider like react-intl .
     *
     * @type {Function}
     * @memberOf options
     */
    render?: Function;
    middlewares?: any;
    /**
     * can use with hake-redux https://github.com/bang88/hake-redux#api
     */
    client?: any;
}
export interface Render {
    store: any;
    routes: RouteConfig;
    history: History;
}
/**
 * configure routes and others then start the app immediately
 * @param {options} options
 */
declare const hake: ({initialState, asyncReducers, history, render, routes, rootReducer, middlewares, client}: options) => {
    store: Store<{}>;
    start: (target?: string) => Element;
};
export default hake;

Contribute

This package is used for special project, if you want use it in your project just clone it.

License

MIT © bang88