@liquid-state/iwa-desktop
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -6,5 +6,5 @@ import { NoopCommunicator } from './noopCommunicator'; | ||
createNoopCommunicator: () => NoopCommunicator; | ||
injectDefaultMiddleware: (communicator: INativeCommunicator) => INativeCommunicator; | ||
injectDefaultMiddleware: (communicator: INativeCommunicator) => INativeCommunicator | undefined; | ||
}; | ||
export default _default; | ||
export { middleware, NoopCommunicator }; |
import { INativeCommunicator, WrappedSendingMessage } from '@liquid-state/iwa-core/dist/communicator/communicator'; | ||
declare const _default: { | ||
injectDefaultMiddleware: (communicator: INativeCommunicator) => INativeCommunicator; | ||
injectDefaultMiddleware: (communicator: INativeCommunicator) => INativeCommunicator | undefined; | ||
config: (config: { | ||
@@ -5,0 +5,0 @@ [key: string]: any; |
@@ -5,2 +5,5 @@ import config from './config'; | ||
var injectDefaultMiddleware = function (communicator) { | ||
if (!communicator.addOnSendMiddleware) { | ||
return; | ||
} | ||
communicator.addOnSendMiddleware(navigation); | ||
@@ -7,0 +10,0 @@ communicator.addOnSendMiddleware(keyValue); |
@@ -1,11 +0,15 @@ | ||
var kv = null; | ||
var _kv = null; | ||
var getKV = function () { | ||
if (!kv) { | ||
kv = localStorage.getItem('kv'); | ||
if (!kv) { | ||
kv = '{}'; | ||
if (!_kv) { | ||
_kv = localStorage.getItem('kv'); | ||
if (!_kv) { | ||
_kv = '{}'; | ||
} | ||
} | ||
return JSON.parse(kv); | ||
return JSON.parse(_kv); | ||
}; | ||
var updateKv = function (value) { | ||
_kv = JSON.stringify(value); | ||
localStorage.setItem('kv', _kv); | ||
}; | ||
var get = function (message) { | ||
@@ -35,3 +39,3 @@ var kv = getKV(); | ||
}); | ||
localStorage.setItem('kv', JSON.stringify(kv)); | ||
updateKv(kv); | ||
return result; | ||
@@ -38,0 +42,0 @@ }; |
{ | ||
"name": "@liquid-state/iwa-desktop", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A set of functions and utilities to make it easy to run IWAs in a desktop environment.", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17653
202