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

djinn-state-react

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djinn-state-react - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

dist/hooks.d.ts

1

dist/index.d.ts
export { createDjinnConnector } from './createDjinnConnector';
export { djinnConnector } from './djinnConnector';
export { DjinnConnection } from './DjinnConnection';
export { createUseService } from './hooks';
//# sourceMappingURL=index.d.ts.map

@@ -9,1 +9,3 @@ "use strict";

exports.DjinnConnection = DjinnConnection_1.DjinnConnection;
var hooks_1 = require("./hooks");
exports.createUseService = hooks_1.createUseService;

2

package.json
{
"name": "djinn-state-react",
"version": "1.3.1",
"version": "1.4.0",
"description": "djinn-state helpers for react",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -31,6 +31,6 @@ # Djinn-state react

import { Djinn, DjinnService } from 'djinn-state';
import { createDjinnConnector } from 'djinn-state-react';
import { createUseService } from 'djinn-state-react';
export const djinn = new Djinn();
export const connect = createDjinnConnector(djinn);
export const useService = createUseService(djinn);

@@ -64,16 +64,18 @@

import React from 'react';
import { connect } from './djinn';
import { useService } from './djinn';
import { CounterService } from './CounterService';
const HomePage = ({ services, state }) => (
<div>
<button onClick={services.CounterService.decrement}>-</button>
{state.CounterService.count}
<button onClick={services.CounterService.increment}>+</button>
</div>
);
const HomePage = ({ services, state }) => {
const counter = useService(CounterService);
return (
<div>
<button onClick={counter.decrement}>-</button>
{counter.state.count}
<button onClick={counter.increment}>+</button>
</div>
);
}
export default connect({
CounterService,
})(HomePage);
export default HomePage;
```
export { createDjinnConnector } from './createDjinnConnector';
export { djinnConnector } from './djinnConnector';
export { DjinnConnection } from './DjinnConnection';
export { createUseService } from './hooks';

Sorry, the diff of this file is not supported yet

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