Skip to content

Commit

Permalink
Merge pull request #159 from Tradeshift/elkin/PATCH-430-update-deps
Browse files Browse the repository at this point in the history
PATCH-430: update all dependencies
  • Loading branch information
aleks-elkin committed May 23, 2023
2 parents d687c26 + 6579e5a commit 4c30139
Show file tree
Hide file tree
Showing 14 changed files with 11,210 additions and 7,202 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
last 2 Chrome versions
last 2 ChromeAndroid versions
last 2 Edge versions
IE 11
last 2 Firefox versions
last 2 FirefoxAndroid versions
last 2 iOs versions
Expand All @@ -10,3 +9,4 @@ last 2 OperaMobile versions
last 2 Safari versions
last 2 Samsung versions
not dead
IE 11
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
timeout-minutes: 30
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14
node-version-file: .nvmrc
cache: 'npm'

- name: 📥 Download deps
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
76 changes: 38 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![travis](https://travis-ci.org/Tradeshift/io.svg?branch=master)](https://travis-ci.org/Tradeshift/io) [![npm](https://img.shields.io/npm/v/@tradeshift/io.svg)](https://npmjs.org/package/@tradeshift/io) [![Greenkeeper badge](https://badges.greenkeeper.io/Tradeshift/io.svg)](https://greenkeeper.io/)
[![npm](https://img.shields.io/npm/v/@tradeshift/io.svg)](https://npmjs.org/package/@tradeshift/io) [![Github](https://img.shields.io/github/v/release/tradeshift/io)](https://github.com/Tradeshift/io/releases/latest)

# `ts.io`

Expand Down Expand Up @@ -41,25 +41,25 @@ const app = io();

// Spawn an App:
(async () => {
// Do the actual spawn call
const [err, data] = await app.spawn(targetApp, targetData);

if (err) {
// Something went horribly wrong while spawning app
} else {
doSomethingWith(data);
}
// Do the actual spawn call
const [err, data] = await app.spawn(targetApp, targetData);

if (err) {
// Something went horribly wrong while spawning app
} else {
doSomethingWith(data);
}
})();

// Allow your app to be spawned by others:
app.define({
async spawn(data) {
// Wait for user input here...
const userData = await myPrompt();
async spawn(data) {
// Wait for user input here...
const userData = await myPrompt();

// Send response back to parent
return userData;
}
// Send response back to parent
return userData;
}
});
```

Expand All @@ -83,28 +83,28 @@ import io from '@tradeshift/io';
const app = io();

app.define({
async spawn(data) {
// CODE HERE: Animate opening your UI and wait for user input.
async spawn(data) {
// CODE HERE: Animate opening your UI and wait for user input.

// Wait for user input here...
const userData = await myPrompt();
// Wait for user input here...
const userData = await myPrompt();

// CODE HERE: Animate closing your UI.
// CODE HERE: Animate closing your UI.

// Send response back to parent
return userData;
}
// Send response back to parent
return userData;
}
});
```

Callback based Spawn handler if you prefer:

```js
app.define({
spawn(data, submit, parent) {
// Send response back to parent
submit(userData);
}
spawn(data, submit, parent) {
// Send response back to parent
submit(userData);
}
});
```

Expand All @@ -123,10 +123,10 @@ const app = io();
*/

// Listen to all events sent to my App
app.on('*', event => {});
app.on('*', (event) => {});

// Listen to events for a specific topic (sent to my App)
const myListener = event => {};
const myListener = (event) => {};
const myTopic = 'my-topic';
const unlisten = app.on(myTopic, myListener);
// Stop listening
Expand All @@ -146,21 +146,21 @@ app.emit('fly-high', { flameColor: 'red' }, 'Tradeshift.FlamingSkull');

```js
(async () => {
const [err, response] = await app1.emit('topic-with-request', 'App2', data);
if (err) {
// Something went horribly wrong while emitting
} else {
doSomethingWith(response);
}
const [err, response] = await app1.emit('topic-with-request', 'App2', data);
if (err) {
// Something went horribly wrong while emitting
} else {
doSomethingWith(response);
}
})();
app1.emit('topic-with-request', 'App2', data);
app1.emit('topic-without-request', 'App2', data);

app2.on('topic-with-request', event => {
return 'my-response';
app2.on('topic-with-request', (event) => {
return 'my-response';
});

app2.on('topic-without-request', event => {});
app2.on('topic-without-request', (event) => {});
```

<!--
Expand Down
Loading

0 comments on commit 4c30139

Please sign in to comment.