UNPKG

nodebb-plugin-ns-embed

Version:

Embed media and rich content in posts: youtube, vimeo, twitch etc. All embeds are based on the rules. You are encouraged to build your own rules to embed everything what is embeddable.

12 lines (8 loc) 367 B
import {setNewRule} from './actions'; import {getSanitizedName} from '../util/get-sanitized-name'; import {getNewRule} from '../model/selectors'; export function changeNewRuleField(field, value, store) { let rule = {...getNewRule(store.getState())}; rule[field] = field === 'name' ? getSanitizedName(value) : value; store.dispatch(setNewRule(rule)); }