Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
docs(readme.md): Updated readme.md with the new methods how to create…
Browse files Browse the repository at this point in the history
… and configure a store
  • Loading branch information
gallayl committed May 15, 2017
1 parent ba27141 commit bc0713e
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,35 @@ To install the latest stable version
npm install --save sn-redux
```

Set your Sense/Net portal's url with SetSiteUrl method
Create your sense NET portal Repository to use. You can configure your Store to use this repository, when calling Store.ConfigureStore

```
import { SetSiteUrl } from 'sn-client-js';
```ts
import { Repository } from 'sn-client-js';

SetSiteUrl('https://daily.demo.sensenet.com');
```
let repository = new Repository.SnRepository({
RepositoryUrl: 'http://path-to-your-portal.com',
});

So that you can set the url of your Sense/Net portal that you want to communicate with. To enable your external app to send request against your Sense/Net portal change
your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check)
article.
const store = Store.configureStore(
myRootReducer,
myRootEpic, // If not set, the default will be 'Epics.rootEpic'
[middleware1, middleware2], // If not set, only the epicMiddleware will be used
persistedState, // Optional
repository // Optional. If not provided, a Repository with default values will be used
);

Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, use the ```SetServiceToken()``` method to set the same service token on client side.

```
import { SetServiceToken } from 'sn-client-js';

SetServiceToken('myservicetoken');
To enable your external app to send request against your Sense/Net portal change your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check) article.

Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, you can pass to your Repository as a config value on client side.

```ts
let repository = new Repository.SnRepository({
RepositoryUrl: 'http://path-to-your-portal.com',
ODataToken: 'MyODataServiceToken'
});
```

## Import
Expand All @@ -94,22 +105,17 @@ store.dispatch(Actions.Delete(123, false));
Building the project, running all the unit tests and the ts linter and get the code coverage report, use:

```
gulp
npm run build
```

## Running tests

To execute all unit tests, use:
To execute all unit tests and generate coverage reports, use:

```
gulp test
npm t
```

## Generatings code coverage report

```
gulp test:coverage
```

## Examples

Expand Down

0 comments on commit bc0713e

Please sign in to comment.