= ArrayList<Note>() override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = Holder.create(LayoutInflater.from(parent.context.inflate(R.layout.note_item, parent, false)) override fun getItemCount(): Int = notes.size override fun onBindViewHolder(holder: Holder, position: Int) { holder.bind(notes[position]) } fun sync(note: Note) { notes.add(note) notifyItemInserted(notes.size - 1) } }