Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Record, List } from 'immutable'
- const BundleRecord = Record({
- id: null,
- slug: null,
- name: null,
- description: null,
- creator: null,
- shares: List(),
- links_count: null,
- favorited: null,
- created_at: null,
- joined: false
- })
- export default class Bundle extends BundleRecord {
- canRemove (userId) {
- return this.creator === userId
- }
- canShare (userId) {
- return this.creator === userId
- }
- shareIdFor (userId) {
- let share = this.shares.find(share => share.user.id === userId)
- return share ? share.id : null
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement