Skip to content

Commit

Permalink
fix: import/no-named-as-default linter error
Browse files Browse the repository at this point in the history
when consumer project uses Airbnb linter
  • Loading branch information
davidyuk committed Apr 28, 2021
1 parent 683082b commit d63e151
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ function isConnected () {
* @param {Boolean} [params.debug=false] - Debug flag
* @return {Object}
*/

export const BrowserRuntimeConnection = stampit({
export default stampit({
init ({ connectionInfo = {}, port, debug = false }) {
if (!getBrowserAPI().runtime) throw new Error('Runtime is not accessible in your environment')
this.debug = debug
Expand All @@ -112,5 +111,3 @@ export const BrowserRuntimeConnection = stampit({
},
methods: { connect, sendMessage, disconnect, isConnected }
}, WalletConnection)

export default BrowserRuntimeConnection
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const getTarget = () => {
* @param {Boolean} [params.debug=false] - Debug flag
* @return {Object}
*/
export const BrowserWindowMessageConnection = stampit({
export default stampit({
init ({ connectionInfo = {}, target = getTarget(), self = window, origin, sendDirection, receiveDirection = MESSAGE_DIRECTION.to_aepp, debug = false, forceOrigin = false } = {}) {
if (sendDirection && !Object.keys(MESSAGE_DIRECTION).includes(sendDirection)) throw new Error(`sendDirection must be one of [${Object.keys(MESSAGE_DIRECTION)}]`)
if (!Object.keys(MESSAGE_DIRECTION).includes(receiveDirection)) throw new Error(`receiveDirection must be one of [${Object.keys(MESSAGE_DIRECTION)}]`)
Expand All @@ -141,5 +141,3 @@ export const BrowserWindowMessageConnection = stampit({
},
methods: { connect, sendMessage, disconnect, isConnected }
}, WalletConnection)

export default BrowserWindowMessageConnection
4 changes: 1 addition & 3 deletions src/utils/aepp-wallet-communication/connection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { required } from '@stamp/required'
* @param {Object} [options={}] - Initializer object
* @return {Object} WalletConnection instance
*/
export const WalletConnection = required({
export default required({
methods: {
connect: required,
disconnect: required,
Expand Down Expand Up @@ -82,5 +82,3 @@ export const WalletConnection = required({
* @rtype () => Boolean
* @return {Boolean} Is connected
*/

export default WalletConnection
6 changes: 2 additions & 4 deletions src/utils/aepp-wallet-communication/content-script-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function stop () {
* @param {Object} params - Initializer object
* @param {Object} params.pageConnection - Page connection object(@link module:@aeternity/aepp-sdk/es/utils/aepp-wallet-communication/connection/browser-window-message)
* @param {Object} params.extConnection - Extension connection object(module: @aeternity/aepp-sdk/es/utils/aepp-wallet-communication/connection/browser-runtime)
* @return {ContentScriptBridge}
* @return {Object}
*/
export const ContentScriptBridge = stampit({
export default stampit({
init ({ pageConnection, extConnection, allowCrossOrigin = false }) {
if (!window) throw new Error('Window object not found, you can run bridge only in browser')
if (!pageConnection) throw new Error('pageConnection required')
Expand All @@ -77,5 +77,3 @@ export const ContentScriptBridge = stampit({
},
methods: { run, stop }
})

export default ContentScriptBridge

0 comments on commit d63e151

Please sign in to comment.