GithubHelp home page GithubHelp logo

javie's Introduction

Javie

Javie Client-side JavaScript Library is simple toolkit written for Client-side JavaScript. The toolkit can be use separately and only requires file that is marked in the documentation. All the object use object combined with factory pattern to make a reusable global instance or multi-instance (depend which is better).

Javie

Javie simplify the way you define your environment, for instance profiler and logger should only run in "dev" invironment.

/* Define the environment to `dev` */
Javie.detectEnvironment(function () {
  return "dev"
})

Javie.when('dev', function initiateDevEnv () {
  // do something on just dev environment.
})

Javie.when('production', function initiateProdEnv () {
  // do something on just production environment.
})

Javie.run(function initiateAllEnv () {
  // this will be run in any environment.
})

Event Dispatcher

Events is a publisher/subscriber object that you can use in your app.

var say = Javie.listen('simon.say', function (say) {
  jQuery('<p>').text(say).appendTo('body')
})

Javie.emit('simon.say', ['hello world'])
Javie.emit('simon.say', ['good morning'])
Javie.emit('simon.say', ['goodbye'])

// the emit('simon.say') action above will create <p>hello world</p><p>good morning</p><p>goodbye</p>

// to remove an action
Javie.forget(say)

// now emit('simon.say') wouldn't do anything
Javie.emit('simon.say', ['does not output anything'])

javie's People

Contributors

crynobone avatar dependabot[bot] avatar gitter-badger avatar

Stargazers

Suke Han avatar  avatar Salahuddin Hairai avatar Steve Bauman avatar Irfaq Syed avatar Jake Toolson avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

gitter-badger

javie's Issues

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.