Skip to content

Commit

Permalink
small fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
panManfredini committed Oct 24, 2020
1 parent 6293b5e commit aedd2a7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The provided store is reflected to the LitElement property **$**. Supports any s
The store state is deeply-copied to **$**. Direct assignment to the property **$** should be avoided, altough it cannot affect the state.


### Event and Effect API Helper
## Event and Effect API Helper

```js
import {createEvent, createEffect} from "effector"
Expand Down Expand Up @@ -72,7 +72,7 @@ it helps to keep the custom-element decoupled from the app-state (see an example
In some cases can be more convenient to override the `dispatch` getter, if you do so is a good practice to return
a shallow copy of the API object (since it could be used in multiple places).

### React on Store change with user defined function
## React on Store change with user defined function

```js

Expand All @@ -90,7 +90,7 @@ If defined, the function `on_store_update` will be executed any time a store cha
The only argument passed to the function is a copy of the current store. This function will run after the property **$** is
set, but before any of the element's update/render.

### Inheritance
## Inheritance

```js

Expand All @@ -117,15 +117,16 @@ LitElement makes sure that reflected properties of inherited classes are present
applying the mixin multiple times the store is actually swapped, so the provided store of a child class must be a combination
of the parent store and the additional wanted properties.

### Testing Helpers
## Testing Helpers

```ts
it("Detaches from current store", async ()=>{

var ex01 = <example01>document.createElement("example-01");

// this detaches from store (replace with undefined)
ex01.replaceStore();
ex01.replaceStore();
// ex01.replaceStore(newStore);

// the element is not initialized until it is connected
// so usually one need to attach it to the DOM for testing
Expand Down

0 comments on commit aedd2a7

Please sign in to comment.