New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

actml

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actml - npm Package Compare versions

Comparing version 0.31.0 to 0.31.1

2

package.json
{
"name": "actml",
"version": "0.31.0",
"version": "0.31.1",
"description": "Like jsx but for your business logic",

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

@@ -31,5 +31,6 @@ ![ActML](assets/logo.jpg)

* [How to use it](#how-to-use-it)
* [Caveats](#caveats)
* [Introduction](#caveats)
* [Children](#children)
* [Asynchronous](#asynchronous)
* [Context](#context)
* [Hooks](#hooks)

@@ -40,2 +41,3 @@ * [useState](#usestate)

* [usePubSub](#usepubsub)
* [useContext](#usecontext)
* [Examples](#examples)

@@ -138,2 +140,32 @@

### Context
I can't say it better than [React docs](https://reactjs.org/docs/context.html#reactcreatecontext):
> Context provides a way to pass data through the component tree without having to pass props down manually at every level.
```js
import { createContext } from 'actml';
const Context = createContext('<default value>');
const { Provider, Consumer } = Context;
const F = () => {
return (
<Consumer>
{ value => console.log(value) }
</Consumer>
);
};
run(
<Provider value='foo'>
<F />
</Provider>
);
// outputs: 'foo'
```
ActML searches for the `<Provider>` up the tree from the place where the `<Consumer>` is positioned. If it can't find the `<Provider>` then it shows a warning and delivers `<default value>` instead.
## Hooks

@@ -231,2 +263,20 @@

### useContext
Consume the value of a context.
```js
const Context = createContext();
const F = () => {
const value = useContext(Context);
// here value is 'foo'
};
run(
<Context.Provider value='foo'>
<F />
</Context.Provider>
);
```
## Examples

@@ -233,0 +283,0 @@

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