Skip to content

Commit

Permalink
[breaking] change the implementation of the connect function
Browse files Browse the repository at this point in the history
  • Loading branch information
zbigh committed Jan 27, 2022
1 parent 94b750d commit c1d27a0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,27 @@ import { connect } from "loco-js-ui";
connect(connector);
```

# 🤝 Dependencies

🎊 Loco-JS-UI has no dependencies. 🎉


# 👩🏽‍🔬 Tests

```bash
npm run test
```

# 🤝 Dependencies

🎊 Loco-JS-UI has no dependencies. 🎉
# 📈 Changelog

## Major releases 🎙

### 6.0 _(2022-01-XX)_

* the implementation of the `connect` function has been changed
* Loco-JS-UI works with Loco-JS v6


# 📜 License

Expand Down
4 changes: 2 additions & 2 deletions __tests__/deps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Deps from "deps.js";
import { connect } from "index";

const connectorThatOverwrites = {
Env: { loco: { wire: null } },
loco: { getWire: () => {} },
I18n: {
en: {
ui: {
Expand All @@ -15,7 +15,7 @@ const connectorThatOverwrites = {
};

const connectorThatAdds = {
Env: { loco: { wire: null } },
loco: { getWire: () => {} },
I18n: {
pl: {
ui: {
Expand Down
2 changes: 1 addition & 1 deletion dist/loco-ui.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import en from "./locales/en";

const connect = connector => {
Deps.getLocale = connector.getLocale;
Deps.wire = connector.Env.loco.wire;
Deps.wire = connector.loco.getWire();
Deps.I18n = connector.I18n;
Deps.I18n.en = { ...en, ...Deps.I18n.en };
};
Expand Down

0 comments on commit c1d27a0

Please sign in to comment.