sn-redux is a convention driven way of building Sense/Net applications using Redux. It contains all the action types, actions and reducers for built-in Sense/Net Actions and Functions.
sn-redux gives you a standard set of:
- action types: e.g. ADD_CONTENT_SUCCESS
- actions: e.g. updateContentSuccess, updateContentFailure
- reducers: for the action types above e.g. updateContentSuccess
- epics: for streams of actions that are related to the same process e.g. createContentEpic
Get the latest stable version with npm
npm install --save sn-redux
or from the GitHub repository and place the downloaded source into your project. If you want to use only the transpiled JavaScript modules, you can find them in the dist/src folder and import them like
var SN = require('/pathtomodule/sn-redux');
If you want to use the module types you can find them in the src folder. Import them the following way:
import { Actions } from 'sn-redux';
store.dispatch(Actions.Delete(123, false));
To install the latest stable version
npm install --save sn-redux
Set your Sense/Net portal's url with SetSiteUrl method
import { SetSiteUrl } from 'sn-client-js';
SetSiteUrl('https://daily.demo.sensenet.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
article.
var Actions = require('sn-redux').Actions;
store.dispatch(Actions.Delete(123, false));
import { Actions } 'sn-redux';
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
To execute all unit tests, use:
gulp test
gulp test:coverage
import { combineReducers } from 'redux';
import { Reducers } from 'sn-redux';
const collection = Reducers.collection;
const myReducer = combineReducers({
collection,
listByFilter
});
import { Store } from 'sn-redux';
const store = Store.configureStore(myReducer);
import { Content } from 'sn-client-js';
import { Actions } from 'sn-redux';
const parentPath = '/workspaces/Project/budapestprojectworkspace/tasks';
const content = new Content({
Type: 'Task',
DisplayName: 'My first task'
});
dispatch(Actions.CreateContent(parentPath, content))
- sn-redux API Reference
- sn-client-js API reference
- About OData REST API in Sense/Net ECM
- About Built-in OData Actions and Function in Sense/Net ECM
- Todo App with React, Redux and Sense/Net ECM
- Redux
- Getting started with Redux - Awesome course from the creator of Redux, Dan Abramov.
- Building React Applications with Idiomatic Redux - Another great course of Dan Abramov about building apps with Redux.
- rxjs
- redux-observable
- Using Raw Javascript and HTML (TODO)
- Using React
- Using Angular (TODO)
- Using Angular2 (TODO)
- Using Vue (TODO)
- Using Aurelia (TODO)
- Using Ember (TODO)
- Using Polymer (TODO)
- Using React Native (TODO)