1.0.245 • Published 2 years ago

betajs v1.0.245

Weekly downloads
1,945
License
Apache-2.0
Repository
github
Last release
2 years ago

betajs 1.0.245

Build Status Code Climate NPM Gitter Chat

BetaJS is a general-purpose JavaScript helper module. It contains a variety of helper functions and classes.

Getting Started

You can use the library in the browser, in your NodeJS project and compile it as well.

Browser

	<script src="betajs/dist/betajs.min.js"></script>

NodeJS

	var BetaJS = require('betajs/dist/beta.js');

Compile

	git clone https://github.com/betajs/betajs.git
	npm install
	grunt

Basic Usage

The BetaJS module contains a variety of low-level helper libraries, particularly:

  • Asynchronous behaviour and Promises
  • Object Orientation
  • Event Handling
  • Dynamic Lists and Collections
  • Dynamic Properties
  • Remote Method Invocation
  • String Manipulation and Templating
  • Binary Search Trees
  • Timers and Time
  • Iterators
  • Uris
  • State Machine and Abstract Routing

Properties

	var properties = new BetaJS.Properties.Properties({foobar: "initial value"});

	properties.set("foobar", "second value");

	var value = properties.get("foobar");
	// value === "second value"
	
	properties.of('change:foobar', function(newValue, oldValue) {
		console.log('The value of foobar has been changed from', oldValue, 'to', newValue);
	});

Object Orientation

  TestClass = BetaJS.Class.extend(null, {
  
    y: 0,
  
    fooBar: function (x) {
      console.log("Test Class Instance", "fooBar", x, y);
    }
    
  }, {
  
    staticFooBar: function (x) {
      console.log("Test Class", "staticFooBar", x);
    }
    
  });
  TestClass.staticFooBar(5);
  var first = new TestClass();
  first.y = 1;
  first.foobar(2);
  var second = new TestClass();
  second.y = 3;
  second.foobar(4);
  Test Class  staticFooBar  5
  Test Class Instance  fooBar  2  1
  Test Class Instance  fooBar  4  3

Events

	var events = new BetaJS.Events.Events();

	events.trigger("event_name", event_data1, event_data2);

	events.on("event_name", function (event_arg1, event_arg2) {
		// Do something
	}, function_context);

	events.off("event_name", null, function_context);

Links

ResourceURL
Homepagehttps://betajs.com
Gitgit://github.com/betajs/betajs.git
Repositoryhttps://github.com/betajs/betajs
Bloghttps://blog.betajs.com
Twitterhttps://twitter.com/thebetajs
Gitterhttps://gitter.im/betajs/betajs

Compatability

TargetVersions
Firefox3 - Latest
Chrome18 - Latest
Safari4 - Latest
Opera12 - Latest
Internet Explorer6 - Latest
Edge12 - Latest
iOS3.0 - Latest
YandexLatest
Android4.4 - Latest
NodeJS4.0 - Latest

CDN

ResourceURL
beta.jshttp://cdn.rawgit.com/betajs/betajs/master/dist/beta.js
beta.min.jshttp://cdn.rawgit.com/betajs/betajs/master/dist/beta.min.js
beta-noscoped.jshttp://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.js
beta-noscoped.min.jshttp://cdn.rawgit.com/betajs/betajs/master/dist/beta-noscoped.min.js

Unit Tests

ResourceURL
Test SuiteRun

Weak Dependencies

NameURL
betajs-scopedOpen
betajs-shimsOpen

Main Contributors

  • Oliver Friedmann
  • Victor Lingenthal

License

Apache-2.0

Credits

This software may include modified and unmodified portions of:

  • Underscore, MIT Software License, (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
  • parseUri, MIT Software License, (c) Steven Levithan

Sponsors

  • Ziggeo
  • Browserstack
1.0.244

2 years ago

1.0.243

2 years ago

1.0.245

2 years ago

1.0.242

2 years ago

1.0.241

2 years ago

1.0.240

2 years ago

1.0.239

2 years ago

1.0.238

3 years ago

1.0.237

3 years ago

1.0.236

3 years ago

1.0.235

3 years ago

1.0.234

3 years ago

1.0.233

4 years ago

1.0.232

4 years ago

1.0.231

4 years ago

1.0.230

4 years ago

1.0.229

4 years ago

1.0.228

4 years ago

1.0.227

4 years ago

1.0.224

4 years ago

1.0.223

4 years ago

1.0.226

4 years ago

1.0.225

4 years ago

1.0.222

4 years ago

1.0.221

4 years ago

1.0.220

4 years ago

1.0.219

4 years ago

1.0.218

5 years ago

1.0.217

5 years ago

1.0.216

5 years ago

1.0.215

5 years ago

1.0.214

5 years ago

1.0.213

5 years ago

1.0.212

5 years ago

1.0.211

5 years ago

1.0.210

5 years ago

1.0.209

5 years ago

1.0.208

5 years ago

1.0.207

5 years ago

1.0.206

5 years ago

1.0.205

5 years ago

1.0.204

5 years ago

1.0.203

5 years ago

1.0.202

5 years ago

1.0.201

5 years ago

1.0.200

6 years ago

1.0.199

6 years ago

1.0.197

6 years ago

1.0.196

6 years ago

1.0.195

6 years ago

1.0.194

6 years ago

1.0.193

6 years ago

1.0.191

6 years ago

1.0.188

6 years ago

1.0.187

6 years ago

1.0.185

6 years ago

1.0.184

6 years ago

1.0.183

6 years ago

1.0.182

6 years ago

1.0.181

6 years ago

1.0.180

6 years ago

1.0.179

6 years ago

1.0.178

6 years ago

1.0.177

6 years ago

1.0.176

7 years ago

1.0.175

7 years ago

1.0.174

7 years ago

1.0.173

7 years ago

1.0.172

7 years ago

1.0.171

7 years ago

1.0.169

7 years ago

1.0.168

7 years ago

1.0.167

7 years ago

1.0.166

7 years ago

1.0.165

7 years ago

1.0.164

7 years ago

1.0.163

7 years ago

1.0.162

7 years ago

1.0.161

7 years ago

1.0.160

7 years ago

1.0.159

7 years ago

1.0.158

7 years ago

1.0.157

7 years ago

1.0.155

7 years ago

1.0.154

7 years ago

1.0.153

7 years ago

1.0.152

7 years ago

1.0.151

7 years ago

1.0.150

7 years ago

1.0.149

7 years ago

1.0.148

7 years ago

1.0.147

7 years ago

1.0.146

7 years ago

1.0.145

7 years ago

1.0.144

7 years ago

1.0.143

7 years ago

1.0.142

7 years ago

1.0.141

8 years ago

1.0.140

8 years ago

1.0.139

8 years ago

1.0.138

8 years ago

1.0.137

8 years ago

1.0.136

8 years ago

1.0.135

8 years ago

1.0.134

8 years ago

1.0.133

8 years ago

1.0.132

8 years ago

1.0.131

8 years ago

1.0.130

8 years ago

1.0.129

8 years ago

1.0.128

8 years ago

1.0.127

8 years ago

1.0.126

8 years ago

1.0.125

8 years ago

1.0.124

8 years ago

1.0.123

8 years ago

1.0.122

8 years ago

1.0.121

8 years ago

1.0.120

8 years ago

1.0.119

8 years ago

1.0.118

8 years ago

1.0.117

8 years ago

1.0.116

8 years ago

1.0.115

8 years ago

1.0.114

8 years ago

1.0.113

8 years ago

1.0.111

8 years ago

1.0.110

8 years ago

1.0.109

8 years ago

1.0.108

8 years ago

1.0.107

8 years ago

1.0.106

8 years ago

1.0.105

8 years ago

1.0.104

8 years ago

1.0.103

8 years ago

1.0.102

8 years ago

1.0.101

8 years ago

1.0.100

8 years ago

1.0.99

8 years ago

1.0.98

8 years ago

1.0.97

8 years ago

1.0.96

8 years ago

1.0.95

8 years ago

0.0.0

11 years ago