Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return {
items: get(path('feed', 'items')),
type,
loading,
username,
isAuthenticated,
tagName: get(path('feed', 'tagName')),
total: get(path('feed', 'total')),
currentPage: get(path('feed', 'pageNumber')),
fetchFeed: fetchFeedProcess(store),
favoriteArticle: favoriteFeedArticleProcess(store)
};
}
export default StoreContainer(Feeds, 'state', { paths: [['feed']], getProperties });
function getProperties(store: Store, properties: ProfileProperties): ProfileProperties {
const { get, path } = store;
return {
username: properties.username,
type: properties.type,
image: get(path('profile', 'image')),
bio: get(path('profile', 'bio')),
following: get(path('profile', 'following')),
currentUser: get(path('user', 'username')),
followUser: followUserProcess(store)
};
}
export default StoreContainer(Profile, 'state', { paths: [['profile'], ['user']], getProperties });
const { get, path } = store;
return {
email: get(path('register', 'email')),
password: get(path('register', 'password')),
username: get(path('register', 'username')),
errors: get(path('errors')),
inProgress: get(path('register', 'loading')),
onEmailInput: registerEmailInputProcess(store),
onPasswordInput: registerPasswordInputProcess(store),
onUsernameInput: registerUsernameInputProcess(store),
onRegister: registerProcess(store)
};
}
export default StoreContainer(Register, 'state', { paths: [['register'], ['errors']], getProperties });
body: get(path('editor', 'body')),
tag: get(path('editor', 'tag')),
tags: get(path('editor', 'tagList')),
errors: get(path('errors')),
onContentInput: bodyInputProcess(store),
onDescriptionInput: descInputProcess(store),
onTagCreate: addTagProcess(store),
onTagDelete: removeTagProcess(store),
onTagInput: tagInputProcess(store),
onTitleInput: titleInputProcess(store),
onPublishPost: publishArticleProcess(store),
slug: properties.slug
};
}
export default StoreContainer(Editor, 'state', { paths: [['editor'], ['errors']], getProperties });
email: get(path('settings', 'email')),
password: get(path('settings', 'password')),
username: get(path('settings', 'username')),
imageUrl: get(path('settings', 'image')),
bio: get(path('settings', 'bio')),
onEmailInput: emailInputProcess(store),
onPasswordInput: passwordInputProcess(store),
onUsernameInput: usernameInputProcess(store),
onBioInput: bioInputProcess(store),
onImageUrlInput: imageUrlInputProcess(store),
onUpdateSettings: updateUserSettingsProcess(store),
logout: logoutProcess(store)
};
}
export default StoreContainer(Settings, 'state', { paths: [['settings']], getProperties });
function getProperties(store: Store): LoginProperties {
const { get, path } = store;
return {
email: get(path('login', 'email')),
password: get(path('login', 'password')),
errors: get(path('errors')),
inProgress: get(path('login', 'loading')),
onEmailInput: loginEmailInputProcess(store),
onPasswordInput: loginPasswordInputProcess(store),
onLogin: loginProcess(store)
};
}
export default StoreContainer(Login, 'state', { paths: [['login'], ['errors']], getProperties });
import { Store } from '@dojo/framework/stores/Store';
import { Tags, TagsProperties } from './../widgets/Tags';
import { fetchFeedProcess } from '../processes/feedProcesses';
import { State } from '../interfaces';
import { StoreContainer } from '@dojo/framework/stores/StoreInjector';
function getProperties(store: Store): TagsProperties {
const { get, path } = store;
return {
tags: get(path('tags')) || [],
fetchFeed: fetchFeedProcess(store)
};
}
export default StoreContainer(Tags, 'state', { paths: [['tags']], getProperties });
import { Store } from '@dojo/framework/stores/Store';
import { Tags, TagsProperties } from './../widgets/Tags';
import { fetchFeedProcess } from '../processes/feedProcesses';
import { State } from '../interfaces';
import { StoreContainer } from '@dojo/framework/stores/StoreInjector';
function getProperties(store: Store): TagsProperties {
const { get, path } = store;
return {
tags: get(path('tags')) || [],
fetchFeed: fetchFeedProcess(store)
};
}
export default StoreContainer(Tags, 'state', { paths: [['tags']], getProperties });
const { get, path } = store;
return {
email: get(path('register', 'email')),
password: get(path('register', 'password')),
username: get(path('register', 'username')),
errors: get(path('errors')),
inProgress: get(path('register', 'loading')),
onEmailInput: registerEmailInputProcess(store),
onPasswordInput: registerPasswordInputProcess(store),
onUsernameInput: registerUsernameInputProcess(store),
onRegister: registerProcess(store)
};
}
export default StoreContainer(Register, 'state', { paths: [['register'], ['errors']], getProperties });
function getProperties(store: Store, properties: ProfileProperties): ProfileProperties {
const { get, path } = store;
return {
username: properties.username,
type: properties.type,
image: get(path('profile', 'image')),
bio: get(path('profile', 'bio')),
following: get(path('profile', 'following')),
currentUser: get(path('user', 'username')),
followUser: followUserProcess(store)
};
}
export default StoreContainer(Profile, 'state', { paths: [['profile'], ['user']], getProperties });