How to use the @dojo/framework/stores/StoreInjector.StoreContainer function in @dojo/framework

To help you get started, we’ve selected a few @dojo/framework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dojo / examples / realworld / src / containers / FeedsContainer.ts View on Github external
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 });
github gothinkster / dojo-realworld-example-app / src / containers / ProfileContainer.ts View on Github external
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 });
github dojo / examples / realworld / src / containers / RegisterContainer.ts View on Github external
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 });
github gothinkster / dojo-realworld-example-app / src / containers / EditorContainer.ts View on Github external
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 });
github dojo / examples / realworld / src / containers / SettingsContainer.ts View on Github external
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 });
github gothinkster / dojo-realworld-example-app / src / containers / LoginContainer.ts View on Github external
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 });
github dojo / examples / realworld / src / containers / TagsContainer.ts View on Github external
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 });
github gothinkster / dojo-realworld-example-app / src / containers / TagsContainer.ts View on Github external
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 });
github gothinkster / dojo-realworld-example-app / src / containers / RegisterContainer.ts View on Github external
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 });
github dojo / examples / realworld / src / containers / ProfileContainer.ts View on Github external
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 });