Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@startup-booster/move-mobx

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@startup-booster/move-mobx - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

7

move-mobx.d.ts

@@ -0,1 +1,2 @@

import React from 'react';
import { MoveClient } from '@startup-booster/move';

@@ -27,1 +28,7 @@

): MoveMobxCollection
export interface IConnectionProviderProps {
url: string,
renderBeforeConnection: boolean,
}
export type ConnectionProvider = React.FC<IConnectionProviderProps>

25

move-mobx.js
const { observable } = require('mobx');
const { connect: baseConnect } = require('@startup-booster/move');
const { useEffect, useMemo, useState } = require('react');
const { useEffect, useMemo, useState, createContext, useContext } = require('react');

@@ -59,3 +59,8 @@ /** @type {function(string): MoveMobxClient} */

const useConnection = url => {
const ConnectionContext = createContext({
connection: /** @type {MoveMobxClient} */(null),
connected: false
});
const ConnectionProvider = ({url, renderBeforeConnection = false, children}) => {
const connection = useMemo(() => connect(url), []);

@@ -72,8 +77,15 @@ const [connected, setConnected] = useState(false);

return {
connection,
connected,
};
const contextValue = useMemo(() => ({ connection, connected }), [connection, connected]);
if (!connected && !renderBeforeConnection) {
return null;
}
return <ConnectionContext.Provider value={contextValue}>
{children}
</ConnectionContext.Provider>
};
const useConnection = () => useContext(ConnectionContext);
const useMoveValue = (

@@ -131,2 +143,3 @@ connection,

useMoveCollection,
ConnectionProvider
}
{
"name": "@startup-booster/move-mobx",
"version": "0.1.10",
"version": "0.1.11",
"main": "move-mobx.js",
"license": "MIT",
"dependencies": {
"@startup-booster/move": "0.1.10"
"@startup-booster/move": "0.1.11"
},

@@ -9,0 +9,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc