Coder Social home page Coder Social logo

snippet's Introduction

Oni JavaScript Snippet

License

Oni JavaScript Snippet for Visual Studio Code

The extension that provide JavaScript and umi snippets for using in Visual Studio Code.

Recommended configurations

To keep snippets to show on the top of suggestions for easy using, use this configuration.

{
	"editor.snippetSuggestions": "top"
}

Snippets

JavaScript Snippets

like: define、forof、forin、foreach、function...

UMI Snippets

[umi-mock] Umi Mock

'/api/hello'(req, res) {
    res.end(`hello ${Math.random()}`);
},

[umi-subscriptions] Umi model subscriptions

setup({ dispatch, history }) {
      return history.listen(({ pathname, query }) => {
        if (pathname === '/') {
          dispatch({ type: 'fetch', payload: query });
        }
      });
},

[umi-effects] Umi model effects

*fetch({ payload: { page = 1 } }, { call, put }) {
      const { data, headers } = yield call(usersService.fetch, { page });
      yield put({
        type: 'save',
        payload: {
          data,
          total: parseInt(headers['x-total-count'], 10),
          page: parseInt(page, 10),
        },
      });
    },

[umi-service] Umi service request

export function create(values) {
  return request('/api/users', {
    method: 'POST',
    body: JSON.stringify(values),
  });
}

snippet's People

Contributors

xiaohuoni avatar

Stargazers

Yanghc avatar

Watchers

James Cloos avatar  avatar

snippet's Issues

命令整理

命令:
hello world
connect
reducers
effects
put
select
call
subscriptions
component
page
classname
mock
service
layout
404
proxy

文件:
.eslintrc
.umirc.js
.umijs.mock.js
.webpackrc.js
环境变量:
略(写的时候参照官方文档)

路由:
重定向
权限
嵌套

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.