This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! (c) 2016 Andrea Giammarchi - MIT Style License */ | |
// simple state-like objects handler | |
// based on prototypal inheritance | |
function State() {'use strict';} | |
// States are serializable dictionaries | |
// toJSON and toString are the only reserved keywords | |
// every other name can be used as name (included __proto__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import renderer from 'react-test-renderer'; | |
//children mock need to be defined before parent module import | |
jest.mock('react-bootstrap-table', () => { | |
return { | |
BootstrapTable: 'BootstrapTable', | |
TableHeaderColumn: 'TableHeaderColumn', | |
}; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function i18n(template) { | |
for (var | |
info = i18n.db[i18n.locale][template.join('\x01')], | |
out = [info.t[0]], | |
i = 1, length = info.t.length; i < length; i++ | |
) out[i] = arguments[1 + info.v[i - 1]] + info.t[i]; | |
return out.join(''); | |
} | |
i18n.locale = 'en'; | |
i18n.db = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on this blog post: https://medium.com/@iquardt/taming-the-dom-50c8f1a6e892 | |
/* RULES | |
* Only the program may manipulate the output display, never the user | |
* User input is presented in the form of events | |
* GUI elements generate events only in response to user input, never in response to program output | |
*/ |
OlderNewer