Skip to content

Commit 2cc51b5

Browse files
committed
WIP: migrate to es2015 syntax
1 parent 76d29fb commit 2cc51b5

16 files changed

+47
-681
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"stateless"
2828
],
2929
"dependencies": {
30-
"immutable": "^3.7.3",
31-
"babel-core": "^5.8.29",
32-
"babel-loader": "^5.3.2"
30+
"immutable": "^3.7.3"
3331
},
3432
"devDependencies": {
3533
"grunt": "^0.4.5",
34+
"babel-core": "^5.8.29",
35+
"babel-loader": "^5.3.2",
3636
"grunt-contrib-clean": "^0.6.0",
3737
"grunt-eslint": "^14.0.0",
3838
"grunt-githooks": "^0.3.1",

src/change-observer.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/create-react-mixin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var each = require('./utils').each
1+
import { each } from './utils'
2+
23
/**
34
* @param {Reactor} reactor
45
*/
5-
module.exports = function(reactor) {
6+
export default function(reactor) {
67
return {
78
getInitialState: function() {
89
return getState(reactor, this.getDataBindings())

src/evaluator.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/getter.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import Immutable from 'immutable'
2-
import { List } from 'immutable'
3-
4-
var isFunction = require('./utils').isFunction
5-
var isArray = require('./utils').isArray
6-
var isKeyPath = require('./key-path').isKeyPath
1+
import Immutable, { List } from 'immutable'
2+
import { isFunction, isArray } from './utils'
3+
import { isKeyPath } from './key-path'
74

85
/**
96
* Getter helper functions

src/hash-code.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/immutable-helpers.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var Immutable = require('immutable')
2-
var isObject = require('./utils').isObject
1+
import Immutable from 'immutable'
2+
import { isObject } from './utils'
33

44
/**
55
* A collection of helpers for the ImmutableJS library
@@ -9,7 +9,7 @@ var isObject = require('./utils').isObject
99
* @param {*} obj
1010
* @return {boolean}
1111
*/
12-
function isImmutable(obj) {
12+
export function isImmutable(obj) {
1313
return Immutable.Iterable.isIterable(obj)
1414
}
1515

@@ -19,7 +19,7 @@ function isImmutable(obj) {
1919
* @param {*} obj
2020
* @return {boolean}
2121
*/
22-
function isImmutableValue(obj) {
22+
export function isImmutableValue(obj) {
2323
return (
2424
isImmutable(obj) ||
2525
!isObject(obj)
@@ -30,7 +30,7 @@ function isImmutableValue(obj) {
3030
* Converts an Immutable Sequence to JS object
3131
* Can be called on any type
3232
*/
33-
function toJS(arg) {
33+
export function toJS(arg) {
3434
// arg instanceof Immutable.Sequence is unreliable
3535
return (isImmutable(arg))
3636
? arg.toJS()
@@ -41,13 +41,9 @@ function toJS(arg) {
4141
* Converts a JS object to an Immutable object, if it's
4242
* already Immutable its a no-op
4343
*/
44-
function toImmutable(arg) {
44+
export function toImmutable(arg) {
4545
return (isImmutable(arg))
4646
? arg
4747
: Immutable.fromJS(arg)
4848
}
4949

50-
exports.toJS = toJS
51-
exports.toImmutable = toImmutable
52-
exports.isImmutable = isImmutable
53-
exports.isImmutableValue = isImmutableValue

src/is-equal.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)