Skip to content

Commit

Permalink
chore(app): v0.2.2 define nos in context
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Peeters committed May 23, 2018
1 parent d062c37 commit 272c7e5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
22 changes: 22 additions & 0 deletions es6/react/nosStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
import React from "react";

import {
claimGas,
getAddress,
getBalance,
getStorage,
invoke,
send,
testInvoke
} from "./../bindings";
import { exists } from "./../lib";

const nos = {
claimGas,
exists,
getAddress,
getBalance,
getStorage,
invoke,
send,
testInvoke
};

const { Provider, Consumer } = React.createContext(nos);

const injectNOS = Component => props => (
Expand Down
15 changes: 15 additions & 0 deletions lib/react/nosStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,25 @@ exports.injectNOS = exports.Consumer = void 0;

var _react = _interopRequireDefault(require("react"));

var _bindings = require("./../bindings");

var _lib = require("./../lib");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var nos = {
claimGas: _bindings.claimGas,
exists: _lib.exists,
getAddress: _bindings.getAddress,
getBalance: _bindings.getBalance,
getStorage: _bindings.getStorage,
invoke: _bindings.invoke,
send: _bindings.send,
testInvoke: _bindings.testInvoke
};

var _React$createContext = _react.default.createContext(nos),
Provider = _React$createContext.Provider,
Consumer = _React$createContext.Consumer;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nosplatform/api-functions",
"version": "0.2.1",
"version": "0.2.2",
"description": "nOS API bindings and types",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 272c7e5

Please sign in to comment.